Skip to content

Commit b0a4b2d

Browse files
felipecgitster
authored andcommitted
completion: add support for backwards compatibility
Some people might be relying on _git and _gitk to define custom aliases, unfortunately, commit 6b179ad (completion: add new __git_complete helper) broke that support. "bash: [: 1: unary operator expected" This can be easily fixed by using __git_complete, but it's not meant to be public. Although _git and _gitk are probably not meant to be public, it's easy to keep having support for them by having a wrapper to the proper new function that is fully functional. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7f02f3d commit b0a4b2d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2702,6 +2702,18 @@ __git_complete ()
27022702
|| complete -o default -o nospace -F $wrapper $1
27032703
}
27042704

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

0 commit comments

Comments
 (0)