Merge branch 'ma/bash-completion-leaking-x' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Apr 2015 19:23:51 +0000 (12:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Apr 2015 19:23:51 +0000 (12:23 -0700)
The completion script (in contrib/) contaminated global namespace
and clobbered on a shell variable $x.

* ma/bash-completion-leaking-x:
completion: fix global bash variable leak on __gitcompappend

contrib/completion/git-completion.bash
index 661a8294dac162f0e50ccfe588847bb45b572143..16205467b1303100b5d67f55371aff749ff5c57d 100644 (file)
@@ -186,7 +186,7 @@ fi
 
 __gitcompappend ()
 {
-       local i=${#COMPREPLY[@]}
+       local i=${#COMPREPLY[@]}
        for x in $1; do
                if [[ "$x" == "$3"* ]]; then
                        COMPREPLY[i++]="$2$x$4"