Merge branch 'fc/zsh-leftover-bits'
authorJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:47:33 +0000 (15:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 2 Jun 2013 22:47:33 +0000 (15:47 -0700)
* fc/zsh-leftover-bits:
completion: zsh: improve bash script loading
completion: synchronize zsh wrapper
completion: cleanup zsh wrapper

1  2 
contrib/completion/git-completion.bash
index 1c35eef56a6bd5295f994c2edd12b40db8dfde06,b61f6c2731b45cb2c3b649b8d216940b8c489172..adeff8d9badee3bde9339b90e7b37e5d4dabc305
@@@ -1831,7 -1831,7 +1831,7 @@@ _git_config (
                local remote="${prev#remote.}"
                remote="${remote%.fetch}"
                if [ -z "$cur" ]; then
 -                      __gitcompadd "refs/heads/" "" "" ""
 +                      __gitcomp_nl "refs/heads/" "" "" ""
                        return
                fi
                __gitcomp_nl "$(__git_refs_remotes "$remote")"
@@@ -2451,7 -2451,7 +2451,7 @@@ _git_svn (
                        --no-metadata --use-svm-props --use-svnsync-props
                        --log-window-size= --no-checkout --quiet
                        --repack-flags --use-log-author --localtime
 -                      --ignore-paths= $remote_opts
 +                      --ignore-paths= --include-paths= $remote_opts
                        "
                local init_opts="
                        --template= --shared= --trunk= --tags=
@@@ -2663,7 -2663,7 +2663,7 @@@ if [[ -n ${ZSH_VERSION-} ]]; the
                                --*=*|*.) ;;
                                *) c="$c " ;;
                                esac
-                               array[$#array+1]="$c"
+                               array+=("$c")
                        done
                        compset -P '*[=:]'
                        compadd -Q -S '' -p "${2-}" -a -- array && _ret=0
                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
-               let _ret && _default -S '' && _ret=0
+               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 && _ret=0
                return _ret
        }