summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2020-12-30 23:29:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-04 23:25:56 (GMT)
commit810df0ea8ed00f31d372f3fd90c205d953aea1e6 (patch)
tree4ccb17826290f963704c5d28f6818d6a6596610c /contrib/completion
parent7f94b78ddabdb49cde32b088ca66b422e7cda628 (diff)
downloadgit-810df0ea8ed00f31d372f3fd90c205d953aea1e6.zip
git-810df0ea8ed00f31d372f3fd90c205d953aea1e6.tar.gz
git-810df0ea8ed00f31d372f3fd90c205d953aea1e6.tar.bz2
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>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 869c73e..1150d4b 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 () {