git-completion.bash: replace zsh notation that breaks bash 3.X
authorBrandon Casey <drafnel@gmail.com>
Fri, 18 Jan 2013 19:24:01 +0000 (11:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 24 Jul 2013 15:45:49 +0000 (08:45 -0700)
50c5885e (git-completion.bash: replace zsh notation that breaks bash
3.X, 2013-01-18) fixed a zsh-ism introduced earlier to append to an
array, which older versions of bash (3.0) did not grok. This was
again broken by 734b2f05 (completion: synchronize zsh wrapper,
2013-05-08).

Cherry-pick the fix again to let those with older bash use the
completion script.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index adeff8d9badee3bde9339b90e7b37e5d4dabc305..67736c2a9c9aba150ca1ec8e2f14e803e84a125d 100644 (file)
@@ -2663,7 +2663,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then
                                --*=*|*.) ;;
                                *) c="$c " ;;
                                esac
-                               array+=("$c")
+                               array[$#array+1]="$c"
                        done
                        compset -P '*[=:]'
                        compadd -Q -S '' -p "${2-}" -a -- array && _ret=0