summaryrefslogtreecommitdiff
path: root/git
diff options
context:
space:
mode:
authorArnaud Patard <apatard@hupstream.com>2020-09-28 12:24:33 +0000
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-09-28 20:39:17 +0800
commit624eb284e0e6edc4aabf0afbdc1438e32d13f4c9 (patch)
tree13a8ccb9c89bf5a1e308da4e0521974eedb1076f /git
parent135e7750f6b70702de6ce55633f2e508188a5c05 (diff)
downloadgitpython-624eb284e0e6edc4aabf0afbdc1438e32d13f4c9.tar.gz
git/repo/base.py: is_dirty(): Fix pathspec handling
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>
Diffstat (limited to 'git')
-rw-r--r--git/repo/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/git/repo/base.py b/git/repo/base.py
index 2579a7d7..69e3e313 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -639,7 +639,7 @@ class Repo(object):
if not submodules:
default_args.append('--ignore-submodules')
if path:
- default_args.append(path)
+ default_args.extend(["--", path])
if index:
# diff index against HEAD
if osp.isfile(self.index.path) and \