aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Bertogli <albertito@blitiri.com.ar>2017-08-27 18:37:12 +0200
committerAlberto Bertogli <albertito@blitiri.com.ar>2017-08-27 18:37:12 +0200
commit891a9443817329492c75ad99b8ff8899c460dee1 (patch)
treea900bae80f7ccd5e92ed7c07651aee053c8c6570
parentd7f0e4a2650734581d88b5c949868a8e7bcf788d (diff)
downloadgit-arr-fork-891a9443817329492c75ad99b8ff8899c460dee1.zip
git: Don't use an empty pathspec when listing
An empty string as a pathspec element matches all paths, but git has recently started complaining about it, as it could be problematic for some operations like rm. In the future, it will be considered an error. So this patch uses "." instead of the empty pathspec, as recommended. https://github.com/git/git/commit/d426430e6ec2a05bf0a4ee88c319dd6072908504
-rw-r--r--git.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git.py b/git.py
index 636f3a2..2240175 100644
--- a/git.py
+++ b/git.py
@@ -525,7 +525,10 @@ class Tree:
cmd.t = None
cmd.arg(self.ref)
- cmd.arg(path)
+ if not path:
+ cmd.arg(".")
+ else:
+ cmd.arg(path)
for l in cmd.run():
_mode, otype, _oid, size, name = l.split(None, 4)