There's no need for a separate function; we can call
'emulate -k ksh func'.

Signed-off-by: Felipe Contreras <felipe.contre...@gmail.com>
---
 contrib/completion/git-completion.bash | 18 +++++-------------
 1 file 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
        }
-- 
1.8.3.rc1.553.gac13664

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to