completions/git: use our __fish_git wrapper for listing config values

Git completions use wrapper function __fish_git instead of directly
running git. This allows them to be aware of Git's global options, like
--git-dir. Let's use __fish_git also for listing config keys & values,
so it can more accurately list local (= per repo) git configuration.
This commit is contained in:
Johannes Altmanninger 2021-12-27 14:30:52 +01:00
parent ee3a26d849
commit ac428b23e5

View file

@ -576,7 +576,7 @@ function __fish_git_config_keys
# Print already defined config values first # Print already defined config values first
# Config keys may span multiple lines, so parse using null char # Config keys may span multiple lines, so parse using null char
# With -z, key and value are separated by space, not "=" # With -z, key and value are separated by space, not "="
git config -lz | while read -lz key value __fish_git config -lz | while read -lz key value
# Print only first line of value(with an ellipsis) if multiline # Print only first line of value(with an ellipsis) if multiline
printf '%s\t%s\n' $key (string replace \n\n -- $value)[1] printf '%s\t%s\n' $key (string replace \n\n -- $value)[1]
end end