summaryrefslogtreecommitdiff
path: root/test/git/test_repo.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r--test/git/test_repo.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index 65dce590..063b5dff 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -208,8 +208,10 @@ class TestRepo(TestBase):
assert_equal('<git.Repo "%s">' % path, repr(self.rorepo))
def test_is_dirty_with_bare_repository(self):
+ orig_value = self.rorepo._bare
self.rorepo._bare = True
assert_false(self.rorepo.is_dirty())
+ self.rorepo._bare = orig_value
def test_is_dirty(self):
self.rorepo._bare = False
@@ -220,8 +222,10 @@ class TestRepo(TestBase):
# END untracked files
# END working tree
# END index
+ orig_val = self.rorepo._bare
self.rorepo._bare = True
assert self.rorepo.is_dirty() == False
+ self.rorepo._bare = orig_val
def test_head(self):
assert self.rorepo.head.reference.object == self.rorepo.active_branch.object
@@ -552,3 +556,9 @@ class TestRepo(TestBase):
target_type = GitCmdObjectDB
assert isinstance(self.rorepo.odb, target_type)
+ def test_submodules(self):
+ assert len(self.rorepo.submodules) == 1 # non-recursive
+ assert len(self.rorepo.list_submodules(recursive=True)) == 2
+
+ assert isinstance(self.rorepo.submodule("lib/git/ext/gitdb"), Submodule)
+ self.failUnlessRaises(ValueError, self.rorepo.submodule, "doesn't exist")