Merge branch 'ma/bash-completion-leaking-x'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2015 22:28:29 +0000 (15:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2015 22:28:30 +0000 (15:28 -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 fbe597232c11c05c1b8f9c366232d52f050b8d51..5944c824abe9aa4dee8b63b0e91a047125722b22 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"