From: Felipe Contreras Date: Wed, 30 Dec 2020 23:29:48 +0000 (-0600) Subject: completion: bash: improve function detection X-Git-Tag: v2.31.0-rc0~128^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=810df0ea8ed00f31d372f3fd90c205d953aea1e6;p=thirdparty%2Fgit.git completion: bash: improve function detection 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 869c73ee2c..1150d4bf44 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -3359,7 +3359,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 () {