summaryrefslogtreecommitdiff
path: root/git/test/test_index.py
diff options
context:
space:
mode:
authorMarcel <marcel.beining@gmail.com>2019-02-08 11:44:33 +0100
committerSebastian Thiel <sebastian.thiel@icloud.com>2019-10-15 13:27:48 +0200
commit3face9018b70f1db82101bd5173c01e4d8d2b3bf (patch)
tree09d0f58875875753d14dadf8f1f02b0938ec1784 /git/test/test_index.py
parent23b83cd6a10403b5fe478932980bdd656280844d (diff)
downloadgitpython-3face9018b70f1db82101bd5173c01e4d8d2b3bf.tar.gz
allow calling index.add, index.move and index.remove with single items
added testing for it closes #813
Diffstat (limited to 'git/test/test_index.py')
-rw-r--r--git/test/test_index.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py
index 11009239..ee48bae6 100644
--- a/git/test/test_index.py
+++ b/git/test/test_index.py
@@ -772,7 +772,14 @@ class TestIndex(TestBase):
orig_tree = commit.tree
self.assertEqual(index.write_tree(), orig_tree)
# END for each commit
-
+
+ @with_rw_repo('HEAD', bare=False)
+ def test_index_single_addremove(self, rw_repo):
+ path = osp.join('git', 'test', 'test_index.py')
+ self._assert_entries(rw_repo.index.add(path))
+ deleted_files = rw_repo.index.remove(path)
+ assert deleted_files
+
def test_index_new(self):
B = self.rorepo.tree("6d9b1f4f9fa8c9f030e3207e7deacc5d5f8bba4e")
H = self.rorepo.tree("25dca42bac17d511b7e2ebdd9d1d679e7626db5f")