diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-03-02 14:19:05 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-03-02 14:19:05 +0100 |
commit | a5e607e8aa62ca3778f1026c27a927ee5c79749b (patch) | |
tree | c68302cea0d1de786af948e76575cfb8ce7e16ee /git/objects/commit.py | |
parent | 630d030058c234e50d87196b624adc2049834472 (diff) | |
download | gitpython-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.py | 7 |
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) |