From 180a5029bc3a2f0c1023c2c63b552766dc524c41 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 17 Feb 2010 21:07:58 +0100 Subject: git.commit: Added test to assure we handle the first commit correctly regarding its parents --- lib/git/index.py | 2 +- test/git/test_commit.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/git/index.py b/lib/git/index.py index 96d42eaf..3bf1fac9 100644 --- a/lib/git/index.py +++ b/lib/git/index.py @@ -1023,7 +1023,7 @@ class IndexFile(LazyMixin, diff.Diffable): Returns List(path_string, ...) list of paths that have been removed effectively. This is interesting to know in case you have provided a directory or - globs. Paths are relative to the + globs. Paths are relative to the repository. """ args = list() if not working_tree: diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 570ea65e..1e0338d6 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -88,6 +88,11 @@ class TestCommit(TestBase): # traversal should stop when the beginning is reached self.failUnlessRaises(StopIteration, first.traverse().next) + # parents of the first commit should be empty ( as the only parent has a null + # sha ) + assert len(first.parents) == 0 + + @patch_object(Git, '_call_process') def test_rev_list_bisect_all(self, git): """ -- cgit v1.2.3