diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-02-28 20:29:02 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-02-28 20:29:02 +0100 |
commit | 6bfdf93201ea413affd4c8fbe406ea2b4a7c1b6b (patch) | |
tree | 24cb60de55a13bf42d9b66e9b459642ed23fb557 /test/git/test_commit.py | |
parent | 3e14ab55a060a5637e9a4a40e40714c1f441d952 (diff) | |
download | gitpython-6bfdf93201ea413affd4c8fbe406ea2b4a7c1b6b.tar.gz |
Commit.iter_items: Will not restrict comits to the ones containing changes to paths anymore as it will only append '--' if paths are actually given.
Added unittest to verify this
Diffstat (limited to 'test/git/test_commit.py')
-rw-r--r-- | test/git/test_commit.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 1e0338d6..da18f275 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -92,6 +92,24 @@ class TestCommit(TestBase): # sha ) assert len(first.parents) == 0 + def test_iteration(self): + # we can iterate commits + all_commits = Commit.list_items(self.rorepo, 'master') + assert all_commits + assert all_commits == list(self.rorepo.iter_commits()) + + # this includes merge commits + mcomit = Commit(self.rorepo, 'd884adc80c80300b4cc05321494713904ef1df2d') + assert mcomit in all_commits + + # we can limit the result to paths + ltd_commits = list(self.rorepo.iter_commits(paths='CHANGES')) + assert ltd_commits and len(ltd_commits) < len(all_commits) + + # show commits of multiple paths, resulting in a union of commits + less_ltd_commits = list(Commit.iter_items(self.rorepo, 'master', paths=('CHANGES', 'AUTHORS'))) + assert len(ltd_commits) < len(less_ltd_commits) + @patch_object(Git, '_call_process') def test_rev_list_bisect_all(self, git): |