From: Felipe Contreras Date: Tue, 30 Aug 2022 09:31:09 GMT Subject: [PATCH 22/51] completion: zsh: fix for undefined completions Message-ID: <20220830093138.1581538-23-felipe.contreras@gmail.com> In-Reply-To: <20220830093138.1581538-1-felipe.contreras@gmail.com> The parseopt helper can generate the completions even if the function is unspecified. git version -- Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.zsh | 3 +++ t/t9904-zsh-completion.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh index e771a2a53a..30607aa93d 100644 --- a/contrib/completion/git-completion.zsh +++ b/contrib/completion/git-completion.zsh @@ -141,6 +141,9 @@ __git_complete_command () if (( $+functions[$completion_func] )); then emulate ksh -c $completion_func return 0 + elif emulate ksh -c "__git_support_parseopt_helper $command"; then + emulate ksh -c "__git_complete_common $command" + return 0 else return 1 fi diff --git a/t/t9904-zsh-completion.sh b/t/t9904-zsh-completion.sh index cd223b6e2a..14f5e5d9b8 100755 --- a/t/t9904-zsh-completion.sh +++ b/t/t9904-zsh-completion.sh @@ -1015,7 +1015,7 @@ test_expect_success 'completion used completion for alias: !f() { : git