Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
git-completion.bash: use correct Bash/Zsh array length syntax
author
Brandon Casey
<drafnel@gmail.com>
Wed, 21 Aug 2013 20:49:31 +0000
(13:49 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 21 Aug 2013 23:38:47 +0000
(16:38 -0700)
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>
contrib/completion/git-completion.bash
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
4d06473
)
diff --git
a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index 5da920ecd9ec1b64760db863d266fdc9c47502de..e1b73130723a57e7f641236331699e67bb0d4d82 100644
(file)
--- 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