summaryrefslogtreecommitdiff
path: root/t/t9902-completion.sh
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2013-08-21 20:49:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-08-21 23:38:50 (GMT)
commit0ef09702d6b7fbd225d1e7adeca7b32304be529f (patch)
tree0b679443d5efa8c3ca9ca0a6e23aab88a12071a0 /t/t9902-completion.sh
parent5d5812f492dbc1adac718a69d225396620b463fd (diff)
downloadgit-0ef09702d6b7fbd225d1e7adeca7b32304be529f.zip
git-0ef09702d6b7fbd225d1e7adeca7b32304be529f.tar.gz
git-0ef09702d6b7fbd225d1e7adeca7b32304be529f.tar.bz2
t9902-completion.sh: old Bash still does not support array+=('') notation
Old Bash (3.0) which is distributed with RHEL 4.X and other ancient platforms that are still in wide use, does not understand the array+=() notation. Let's use an explicit assignment to the new array element which works everywhere, like: array[${#array[@]}+1]='' The right-hand side '' is not strictly necessary, but in this case I think it is more clear. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9902-completion.sh')
-rwxr-xr-xt/t9902-completion.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 272a071..2d4beb5 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -69,7 +69,7 @@ run_completion ()
local -a COMPREPLY _words
local _cword
_words=( $1 )
- test "${1: -1}" = ' ' && _words+=('')
+ test "${1: -1}" = ' ' && _words[${#_words[@]}+1]=''
(( _cword = ${#_words[@]} - 1 ))
__git_wrap__git_main && print_comp
}