Skip to content

Commit fb3a0ca

Browse files
committed
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
2 parents d7e9611 + 085e2ee commit fb3a0ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

contrib/completion/git-completion.bash

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3073,10 +3073,17 @@ __git_support_parseopt_helper () {
30733073
__git_complete_command () {
30743074
local command="$1"
30753075
local completion_func="_git_${command//-/_}"
3076-
if declare -f $completion_func >/dev/null 2>/dev/null; then
3076+
if ! declare -f $completion_func >/dev/null 2>/dev/null &&
3077+
declare -f _completion_loader >/dev/null 2>/dev/null
3078+
then
3079+
_completion_loader "git-$command"
3080+
fi
3081+
if declare -f $completion_func >/dev/null 2>/dev/null
3082+
then
30773083
$completion_func
30783084
return 0
3079-
elif __git_support_parseopt_helper "$command"; then
3085+
elif __git_support_parseopt_helper "$command"
3086+
then
30803087
__git_complete_common "$command"
30813088
return 0
30823089
else

0 commit comments

Comments
 (0)