Skip to content

Commit 2bcf694

Browse files
felipecgitster
authored andcommitted
completion: cleanup zsh wrapper
There's no need for a separate function; we can call 'emulate -k ksh func'. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9b79519 commit 2bcf694

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

contrib/completion/git-completion.bash

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2689,21 +2689,13 @@ if [[ -n ${ZSH_VERSION-} ]]; then
26892689
compadd -Q -p "${2-}" -f -- ${=1} && _ret=0
26902690
}
26912691

2692-
__git_zsh_helper ()
2693-
{
2694-
emulate -L ksh
2695-
local cur cword prev
2696-
cur=${words[CURRENT-1]}
2697-
prev=${words[CURRENT-2]}
2698-
let cword=CURRENT-1
2699-
__${service}_main
2700-
}
2701-
27022692
_git ()
27032693
{
2704-
emulate -L zsh
2705-
local _ret=1
2706-
__git_zsh_helper
2694+
local _ret=1 cur cword prev
2695+
cur=${words[CURRENT]}
2696+
prev=${words[CURRENT-1]}
2697+
let cword=CURRENT-1
2698+
emulate ksh -c __${service}_main
27072699
let _ret && _default -S '' && _ret=0
27082700
return _ret
27092701
}

0 commit comments

Comments
 (0)