From 582675c96ae453ba5966f9fa1669fc90fc8fcd5c Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 15 Mar 2021 22:27:04 +0100 Subject: [PATCH] completions/git: restore forward-compatibility by using "complete -c" After a fish installation is upgraded to 3.2.0, active shells could throw an error attempting to load Git completions. It's just a transient error but also easily avoidable by using the old style. See #7822 --- share/completions/git.fish | 4 ++-- share/completions/source.fish | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/completions/git.fish b/share/completions/git.fish index 970c7e1f5..f96a8698e 100644 --- a/share/completions/git.fish +++ b/share/completions/git.fish @@ -1923,8 +1923,8 @@ for file in $PATH/git-* and continue complete -C "git-$subcommand " >/dev/null - if [ (complete git-$subcommand | count) -gt 0 ] - complete git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)" + if [ (complete -c git-$subcommand | count) -gt 0 ] + complete -c git -f -n "__fish_git_using_command $subcommand" -a "(__fish_git_complete_custom_command $subcommand)" end set -a __fish_git_custom_commands_completion $subcommand end diff --git a/share/completions/source.fish b/share/completions/source.fish index f80bd6b8f..0f05b04fd 100644 --- a/share/completions/source.fish +++ b/share/completions/source.fish @@ -1,2 +1,2 @@ -complete source -k -xa '(__fish_complete_suffix .fish)' -complete source -s h -l help -d 'Display help and exit' +complete -c source -k -xa '(__fish_complete_suffix .fish)' +complete -c source -s h -l help -d 'Display help and exit'