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 <l.s.r@web.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Dec 30, 2020 at 17:29 UTC 810df0ea8ed00f31d372f3fd90c205d953aea1e6
1 file changed +1 -1
contrib/completion/git-completion.bash
+1 -1
@@ -3359,7 +3359,7 @@ __git_support_parseopt_helper () {
3359 }
3360
3361 __git_have_func () {
3362 - declare -f $1 >/dev/null 2>/dev/null
3362 + declare -f -- "$1" >/dev/null 2>&1
3363 }
3364
3365 __git_complete_command () {