summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:25 (GMT)
commitfb3a0cabf23ccd1d4ae3fead2c5b478930630822 (patch)
treec2fc8f12c55797ec5b35c97e812629cb48dbe7a1 /contrib
parentd7e96110254410c9c9908a13ba2e5e2730ee8f05 (diff)
parent085e2ee0e62a97c2dc56d4a6baf3e03ce124bba9 (diff)
downloadgit-fb3a0cabf23ccd1d4ae3fead2c5b478930630822.zip
git-fb3a0cabf23ccd1d4ae3fead2c5b478930630822.tar.gz
git-fb3a0cabf23ccd1d4ae3fead2c5b478930630822.tar.bz2
Merge branch 'fg/completion-external'
The command line completion mechanism (in contrib/) learned to load custom completion file for "git $command" where $command is a custom "git-$command" that the end user has on the $PATH when using newer version of bash. * fg/completion-external: completion: load completion file for external subcommand
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-completion.bash11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index f2f3311..961a0ed 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3073,10 +3073,17 @@ __git_support_parseopt_helper () {
__git_complete_command () {
local command="$1"
local completion_func="_git_${command//-/_}"
- if declare -f $completion_func >/dev/null 2>/dev/null; then
+ if ! declare -f $completion_func >/dev/null 2>/dev/null &&
+ declare -f _completion_loader >/dev/null 2>/dev/null
+ then
+ _completion_loader "git-$command"
+ fi
+ if declare -f $completion_func >/dev/null 2>/dev/null
+ then
$completion_func
return 0
- elif __git_support_parseopt_helper "$command"; then
+ elif __git_support_parseopt_helper "$command"
+ then
__git_complete_common "$command"
return 0
else