Skip to content

Commit e2a9d68

Browse files
cbleckerches
andcommitted
Fix bash completion with git 2.30.0 and higher
Co-authored-by: Ches Martin <[email protected]>
1 parent efa6685 commit e2a9d68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

etc/hub.bash_completion.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# This script complements the completion script that ships with git.
33

44
# If there is no git tab completion, but we have the _completion loader try to load it
5-
if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
5+
if ! declare -F __git > /dev/null && declare -F _completion_loader > /dev/null; then
66
_completion_loader git
77
fi
88

99
# Check that git tab completion is available and we haven't already set up completion
10-
if declare -F _git > /dev/null && ! declare -F __git_list_all_commands_without_hub > /dev/null; then
10+
if declare -F __git > /dev/null && ! declare -F __git_list_all_commands_without_hub > /dev/null; then
1111
# Duplicate and rename the 'list_all_commands' function
1212
eval "$(declare -f __git_list_all_commands | \
1313
sed 's/__git_list_all_commands/__git_list_all_commands_without_hub/')"
@@ -382,6 +382,6 @@ EOF
382382
}
383383

384384
# Enable completion for hub even when not using the alias
385-
complete -o bashdefault -o default -o nospace -F _git hub 2>/dev/null \
386-
|| complete -o default -o nospace -F _git hub
385+
complete -o bashdefault -o default -o nospace -F __git hub 2>/dev/null \
386+
|| complete -o default -o nospace -F __git hub
387387
fi

0 commit comments

Comments
 (0)