Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2020

Conversation

apatard
Copy link
Contributor

@apatard apatard commented Sep 28, 2020

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 [email protected]

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 <[email protected]>
@Byron Byron added this to the v3.1.9 - Bugfixes milestone Sep 28, 2020
@Byron Byron merged commit 624eb28 into gitpython-developers:master Sep 28, 2020
@Byron
Copy link
Member

Byron commented Sep 28, 2020

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

Sign up for free to 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