summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-04-27 15:34:05 -0500
committerJunio C Hamano <gitster@pobox.com>2013-04-29 09:52:06 -0700
commit1ca6d4bc426435ecb87c6eb7802e83ff0a2f1667 (patch)
tree0a2f08d885ed1823e6d7e673fedd8079e2911131
parent240ae2b8c96c3b9836d516de36dacd65bea9c4a2 (diff)
downloadgit-1ca6d4bc426435ecb87c6eb7802e83ff0a2f1667.tar.gz
complete: zsh: trivial simplification
There should be no functional changes. The only reason I wrapped this code around a sub-function is because zsh did the same in it's bashcompinit script in order to declare the special variable 'words' as hidden, but only in this context. There's no need for that any more since we access __git_main directly, so 'words' is not modified, so there's no need for the sub-function. In zsh mode the array indexes are different though. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--contrib/completion/git-completion.zsh16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/completion/git-completion.zsh b/contrib/completion/git-completion.zsh
index cf8116d477..93d8f42061 100644
--- a/contrib/completion/git-completion.zsh
+++ b/contrib/completion/git-completion.zsh
@@ -72,14 +72,14 @@ __gitcomp_file ()
_git ()
{
local _ret=1
- () {
- emulate -L ksh
- local cur cword prev
- cur=${words[CURRENT-1]}
- prev=${words[CURRENT-2]}
- let cword=CURRENT-1
- __${service}_main
- }
+ local 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
}