From a5e607e8aa62ca3778f1026c27a927ee5c79749b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 2 Mar 2015 14:19:05 +0100 Subject: 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 --- git/objects/commit.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'git/objects/commit.py') 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) -- cgit v1.2.1