Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 5d5812f

Browse files
drafnelgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4d06473 commit 5d5812f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/completion/git-completion.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2580,7 +2580,7 @@ if [[ -n ${ZSH_VERSION-} ]]; then
25802580
--*=*|*.) ;;
25812581
*) c="$c " ;;
25822582
esac
2583-
array[$#array+1]="$c"
2583+
array[${#array[@]}+1]="$c"
25842584
done
25852585
compset -P '*[=:]'
25862586
compadd -Q -S '' -p "${2-}" -a -- array && _ret=0

0 commit comments

Comments
 (0)