Skip to content

Commit 810df0e

Browse files
felipecgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7f94b78 commit 810df0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3359,7 +3359,7 @@ __git_support_parseopt_helper () {
33593359
}
33603360

33613361
__git_have_func () {
3362-
declare -f $1 >/dev/null 2>/dev/null
3362+
declare -f -- "$1" >/dev/null 2>&1
33633363
}
33643364

33653365
__git_complete_command () {

0 commit comments

Comments
 (0)