From 5d5812f492dbc1adac718a69d225396620b463fd Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Wed, 21 Aug 2013 13:49:31 -0700 Subject: [PATCH] git-completion.bash: use correct Bash/Zsh array length syntax The syntax for retrieving the number of elements in an array is: ${#name[@]} Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5da920ecd..e1b731307 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2580,7 +2580,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then --*=*|*.) ;; *) c="$c " ;; esac - array[$#array+1]="$c" + array[${#array[@]}+1]="$c" done compset -P '*[=:]' compadd -Q -S '' -p "${2-}" -a -- array && _ret=0 -- 2.11.0