summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-05 21:56:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-05 21:56:41 (GMT)
commit8cb9b5f787957460e48c7b376f2c219b7130080d (patch)
tree984e50e11a86608eaae4af8299645280e749309e /contrib/completion
parent058a92ad64cfe55190777b7f4ad5f5772f156286 (diff)
parentd0583da838afbc5e039b9f0cbbb9b1fb3aa1f1ae (diff)
downloadgit-8cb9b5f787957460e48c7b376f2c219b7130080d.zip
git-8cb9b5f787957460e48c7b376f2c219b7130080d.tar.gz
git-8cb9b5f787957460e48c7b376f2c219b7130080d.tar.bz2
Merge branch 'tg/maint-zsh-svn-remote-prompt'
zsh prompt script that borrowed from bash prompt script did not work due to slight differences in array variable notation between these two shells. * tg/maint-zsh-svn-remote-prompt: prompt: fix show upstream with svn and zsh
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-prompt.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 92f2770..9f4e6a3 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -125,7 +125,7 @@ __git_ps1_show_upstream ()
fi
;;
svn-remote.*.url)
- svn_remote[ $((${#svn_remote[@]} + 1)) ]="$value"
+ svn_remote[$((${#svn_remote[@]} + 1))]="$value"
svn_url_pattern+="\\|$value"
upstream=svn+git # default upstream is SVN if available, else git
;;
@@ -147,10 +147,11 @@ __git_ps1_show_upstream ()
svn*)
# get the upstream from the "git-svn-id: ..." in a commit message
# (git-svn uses essentially the same procedure internally)
- local svn_upstream=($(git log --first-parent -1 \
+ local -a svn_upstream
+ svn_upstream=($(git log --first-parent -1 \
--grep="^git-svn-id: \(${svn_url_pattern#??}\)" 2>/dev/null))
if [[ 0 -ne ${#svn_upstream[@]} ]]; then
- svn_upstream=${svn_upstream[ ${#svn_upstream[@]} - 2 ]}
+ svn_upstream=${svn_upstream[${#svn_upstream[@]} - 2]}
svn_upstream=${svn_upstream%@*}
local n_stop="${#svn_remote[@]}"
for ((n=1; n <= n_stop; n++)); do