git completions: make :/:-prefixed paths work everywhere on old git

git versions that only support porcelain v1 output (like on CentOS 7,
which has 1.8.3) weren't completing files prefixed with : correctly iff
the name after the colon was also a valid relative path.

Fixes the tests on CentOS 7.
This commit is contained in:
David Adam 2022-06-12 22:10:36 +08:00
parent 6c5f86b2f7
commit 68f67ff46c

View File

@ -487,6 +487,7 @@ function __fish_git_files
end
if test "$root/$relfile" = (pwd -P)/$relfile
and not string match -q ':*' -- (commandline -ct)
set file $relfile
end