From: Felipe Contreras Date: Fri, 01 Jan 2021 02:16:19 GMT Subject: [PATCH 44/47] completion: bash: improve function detection Message-ID: <20210101021622.798041-45-felipe.contreras@gmail.com> In-Reply-To: <20210101021622.798041-1-felipe.contreras@gmail.com> 1. We should quote the argument 2. We don't need two redirections 3. A safeguard for arguments (-a) would be good Suggested-by: René Scharfe Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 4bd3e706ac..11a9433363 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3201,7 +3201,7 @@ __git_support_parseopt_helper () { } __git_have_func () { - declare -f $1 >/dev/null 2>/dev/null + declare -f -- "$1" >/dev/null 2>&1 } __git_complete_command () { -- 2.30.0