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>
This commit is contained in:
Felipe Contreras 2020-12-30 17:29:48 -06:00 committed by Junio C Hamano
parent 7f94b78dda
commit 810df0ea8e

View file

@ -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 () {