completions/git: Trim with the regex

This gives us another few percent.

It's not *technically* the same because `trim` would remove a run of
quotes, but that would be wrong anyway.
This commit is contained in:
Fabian Boehm 2023-07-13 18:05:55 +02:00
parent dd26611c0f
commit 493cbeb84c

View file

@ -196,7 +196,7 @@ function __fish_git_files
if set -ql untracked
# Fast path for untracked files - it is extremely easy to get a lot of these,
# so we handle them first
set -l files (string match -rg '^\? (.*)' -- $stats | string trim -c \")
set -l files (string match -rg '^\? "?(.*)"?' -- $stats)
set stats (string match -rv '^\? ' -- $stats)
printf "$rel%s\n" $files\t$untracked_desc
if set -ql colon[1]