summaryrefslogtreecommitdiff
path: root/git/objects/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/objects/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/objects/commit.py')
-rw-r--r--git/objects/commit.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/git/objects/commit.py b/git/objects/commit.py
index b9718694..f13760fd 100644
--- a/git/objects/commit.py
+++ b/git/objects/commit.py
@@ -189,9 +189,12 @@ class Commit(base.Object, Iterable, Diffable, Traversable, Serializable):
if 'pretty' in kwargs:
raise ValueError("--pretty cannot be used as parsing expects single sha's only")
# END handle pretty
- args = list()
+
+ # use -- in any case, to prevent possibility of ambiguous arguments
+ # see https://github.com/gitpython-developers/GitPython/issues/264
+ args = ['--']
if paths:
- args.extend(('--', paths))
+ args.extend((paths, ))
# END if paths
proc = repo.git.rev_list(rev, args, as_process=True, **kwargs)