completions/git: Work around read trimming whitespace

Since #6406, read will trim whitespace before the last variable.

In this case there is only one variable, and the line looks like

 M CHANGELOG.md

so it does indeed start with whitespace, and the whitespace is quite
significant.

Fixes #6650.

[ci skip]
This commit is contained in:
Fabian Homborg 2020-02-25 18:53:46 +01:00
parent 866df1ac86
commit cebfaa7786

View File

@ -339,7 +339,7 @@ function __fish_git_files
# Note that we can't use space as a delimiter between status and filename, because
# the status can contain spaces - " M" is different from "M ".
__fish_git $git_opt status --porcelain -z $status_opt \
| while read -lz line
| while read -lz -d' ' line
set -l desc
# The entire line is the "from" from a rename.
if set -q use_next[1]