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.

d426430e6e
This commit is contained in:
Alberto Bertogli 2017-08-27 17:37:12 +01:00
parent d7f0e4a265
commit 891a944381

5
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)