Skip to content

Commit b19ea23

Browse files
committed
Merge branch 'fc/git-complete-helper-fix'
Resurrects old behaviour of _git/_gitk for external users.
2 parents aed79af + b0a4b2d commit b19ea23

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

contrib/completion/git-completion.bash

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,7 +2597,7 @@ _git_whatchanged ()
25972597
_git_log
25982598
}
25992599

2600-
_git ()
2600+
_main_git ()
26012601
{
26022602
local i c=1 command __git_dir
26032603

@@ -2648,7 +2648,7 @@ _git ()
26482648
fi
26492649
}
26502650

2651-
_gitk ()
2651+
_main_gitk ()
26522652
{
26532653
__git_has_doubledash && return
26542654

@@ -2700,13 +2700,25 @@ __git_complete ()
27002700
|| complete -o default -o nospace -F $wrapper $1
27012701
}
27022702

2703-
__git_complete git _git
2704-
__git_complete gitk _gitk
2703+
# wrapper for backwards compatibility
2704+
_git ()
2705+
{
2706+
__git_wrap_main_git
2707+
}
2708+
2709+
# wrapper for backwards compatibility
2710+
_gitk ()
2711+
{
2712+
__git_wrap_main_gitk
2713+
}
2714+
2715+
__git_complete git _main_git
2716+
__git_complete gitk _main_gitk
27052717

27062718
# The following are necessary only for Cygwin, and only are needed
27072719
# when the user has tab-completed the executable name and consequently
27082720
# included the '.exe' suffix.
27092721
#
27102722
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
2711-
__git_complete git.exe _git
2723+
__git_complete git.exe _main_git
27122724
fi

t/t9902-completion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ run_completion ()
6363
local _cword
6464
_words=( $1 )
6565
(( _cword = ${#_words[@]} - 1 ))
66-
__git_wrap_git && print_comp
66+
__git_wrap_main_git && print_comp
6767
}
6868

6969
test_completion ()

0 commit comments

Comments
 (0)