Browse Source

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 <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Brandon Casey 12 years ago committed by Junio C Hamano
parent
commit
5d5812f492
  1. 2
      contrib/completion/git-completion.bash

2
contrib/completion/git-completion.bash

@ -2580,7 +2580,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then @@ -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

Loading…
Cancel
Save