Skip to content

Commit

Permalink
completion: add support for backwards compatibility
Browse files Browse the repository at this point in the history
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 <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed May 20, 2012
1 parent 7f02f3d commit b0a4b2d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2702,6 +2702,18 @@ __git_complete ()
|| complete -o default -o nospace -F $wrapper $1
}

# wrapper for backwards compatibility
_git ()
{
__git_wrap_main_git
}

# wrapper for backwards compatibility
_gitk ()
{
__git_wrap_main_gitk
}

__git_complete git _main_git
__git_complete gitk _main_gitk

Expand Down

0 comments on commit b0a4b2d

Please sign in to comment.