summaryrefslogtreecommitdiff
path: root/git/test/test_commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-03-02 14:19:05 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-03-02 14:19:05 +0100
commita5e607e8aa62ca3778f1026c27a927ee5c79749b (patch)
treec68302cea0d1de786af948e76575cfb8ce7e16ee /git/test/test_commit.py
parent630d030058c234e50d87196b624adc2049834472 (diff)
downloadgitpython-a5e607e8aa62ca3778f1026c27a927ee5c79749b.tar.gz
fix(iter-commit): ambiguous argument error
In repositories like > git branch -a * test > ls test `repo.iter_commits` failed due to an ambigous argument (`'git rev-list test`). Now this cannot happen anymore. fixes #264
Diffstat (limited to 'git/test/test_commit.py')
-rw-r--r--git/test/test_commit.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/git/test/test_commit.py b/git/test/test_commit.py
index 1f0f8c56..3e958edf 100644
--- a/git/test/test_commit.py
+++ b/git/test/test_commit.py
@@ -19,15 +19,19 @@ from git import (
Actor,
)
from gitdb import IStream
+from gitdb.test.lib import with_rw_directory
from git.compat import (
string_types,
text_type
)
+from git import Repo
+from git.repo.fun import touch
from io import BytesIO
import time
import sys
import re
+import os
def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False):
@@ -219,6 +223,15 @@ class TestCommit(TestBase):
for sha1, commit in zip(expected_ids, commits):
assert_equal(sha1, commit.hexsha)
+ @with_rw_directory
+ def test_ambiguous_arg_iteration(self, rw_dir):
+ rw_repo = Repo.init(os.path.join(rw_dir, 'test_ambiguous_arg'))
+ path = os.path.join(rw_repo.working_tree_dir, 'master')
+ touch(path)
+ rw_repo.index.add([path])
+ rw_repo.index.commit('initial commit')
+ list(rw_repo.iter_commits(rw_repo.head.ref)) # should fail unless bug is fixed
+
def test_count(self):
assert self.rorepo.tag('refs/tags/0.1.5').commit.count() == 143