Skip to content

git/repo/base.py: is_dirty(): Fix pathspec handling - #1062

Merged
Byron merged 1 commit into
gitpython-developers:masterfrom
apatard:master
Sep 28, 2020
Merged

git/repo/base.py: is_dirty(): Fix pathspec handling#1062
Byron merged 1 commit into
gitpython-developers:masterfrom
apatard:master

Conversation

@apatard

Copy link
Copy Markdown
Contributor

It's possible to specify a pathspec (eg :!foo) to git diff/status/...
but it currently fails with:

git.exc.GitCommandError: Cmd('/usr/bin/git') failed due to: exit code(128)
cmdline: /usr/bin/git diff --abbrev=40 --full-index --raw :!foo
stderr: 'fatal: ambiguous argument ':!foo': unknown revision or path not in the working tree.

Add missing '--' to the arguments to fix this ambiguity

Fixes: #1061
Signed-off-by: Arnaud Patard apatard@hupstream.com

It's possible to specify a pathspec (eg :!foo) to git diff/status/...
but it currently fails with:
git.exc.GitCommandError: Cmd('/usr/bin/git') failed due to: exit code(128)
cmdline: /usr/bin/git diff --abbrev=40 --full-index --raw :!foo
stderr: 'fatal: ambiguous argument ':!foo': unknown revision or path not in the working tree.
Add missing '--' to the arguments to fix this ambiguity
Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@ByronByron added this to the v3.1.9 - Bugfixes milestone Sep 28, 2020
@Byron
Byron merged commit 624eb28 into gitpython-developers:masterSep 28, 2020
@Byron

Copy link
Copy Markdown
Member

Thanks a lot for your contribution, especially for the exhaustive test!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

repo.is_dirty() is not working with a pathspec

2 participants

@apatard@Byron