summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-08 07:37:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-08 18:44:30 (GMT)
commit2bcf694b1892dca372c6d1d64602a017d7291899 (patch)
treec22c44b67f3ad63fa56d37d1017114ac2962c643 /contrib/completion
parent9b795193a6a7e963db62d9cd8e86752a40940520 (diff)
downloadgit-2bcf694b1892dca372c6d1d64602a017d7291899.zip
git-2bcf694b1892dca372c6d1d64602a017d7291899.tar.gz
git-2bcf694b1892dca372c6d1d64602a017d7291899.tar.bz2
completion: cleanup zsh wrapper
There's no need for a separate function; we can call 'emulate -k ksh func'. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash18
1 files changed, 5 insertions, 13 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b97162f..84dbf19 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2689,21 +2689,13 @@ if [[ -n ${ZSH_VERSION-} ]]; then
compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
}
- __git_zsh_helper ()
- {
- emulate -L ksh
- local cur cword prev
- cur=${words[CURRENT-1]}
- prev=${words[CURRENT-2]}
- let cword=CURRENT-1
- __${service}_main
- }
-
_git ()
{
- emulate -L zsh
- local _ret=1
- __git_zsh_helper
+ local _ret=1 cur cword prev
+ cur=${words[CURRENT]}
+ prev=${words[CURRENT-1]}
+ let cword=CURRENT-1
+ emulate ksh -c __${service}_main
let _ret && _default -S '' && _ret=0
return _ret
}