Merge branch 'fc/completion-zsh' into sg/completion-updates
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 May 2011 20:14:58 +0000 (13:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 May 2011 20:14:58 +0000 (13:14 -0700)
* fc/completion-zsh:
  git-completion: fix regression in zsh support

1  2 
contrib/completion/git-completion.bash

index 8ee82cbae5e3b7de06ccd50d77fb8d442564d6d5,a7d20df233c2be8dc36452b02fb5fcabf168c69a..d6ddf81d694abd0ec5c16c20e9a90acfbcb753f2
@@@ -2608,10 -2710,14 +2608,14 @@@ _git (
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
  
 -      local cur words cword
 -      _get_comp_words_by_ref -n =: cur words cword
 +      local cur words cword prev
 +      _get_comp_words_by_ref -n =: cur words cword prev
        while [ $c -lt $cword ]; do
                i="${words[c]}"
                case "$i" in
@@@ -2659,13 -2765,15 +2663,17 @@@ _gitk (
        if [[ -n ${ZSH_VERSION-} ]]; then
                emulate -L bash
                setopt KSH_TYPESET
+               # workaround zsh's bug that leaves 'words' as a special
+               # variable in versions < 4.3.12
+               typeset -h words
        fi
  
 +      local cur words cword prev
 +      _get_comp_words_by_ref -n =: cur words cword prev
 +
        __git_has_doubledash && return
  
 -      local cur
        local g="$(__gitdir)"
        local merge=""
        if [ -f "$g/MERGE_HEAD" ]; then