completions/git: Don't set the read limit

This isn't propagated correctly:

If $fish_read_limit is set globally, it won't apply to the completion
command substitution, *unless* you set fish_read_limit inside of that
function.

I'm not entirely sure how that happens, but let's work around it for
now by removing that limit.

I'm going to increase the default limit in a future commit, because
it's not something supposed to be reachable in ordinary code.

See #11106
This commit is contained in:
Fabian Boehm
2025-01-31 16:33:26 +01:00
parent 6d8f1aeb27
commit 5eee4fc2c7

View File

@@ -186,7 +186,6 @@ function __fish_git_files
set -l ver (__fish_git --version | string replace -rf 'git version (\d+)\.(\d+)\.?.*' '$1\n$2')
# Version >= 2.11.* has the v2 format.
if test "$ver[1]" -gt 2 2>/dev/null; or test "$ver[1]" -eq 2 -a "$ver[2]" -ge 11 2>/dev/null
set -l fish_read_limit 0 # this can print a lot, better not to error
set -l stats (__fish_git $git_opt status --porcelain=2 -uno $status_opt)
if set -ql untracked
# Fast path for untracked files - it is extremely easy to get a lot of these,