summaryrefslogtreecommitdiffstats
path: root/contrib/completion
diff options
context:
space:
mode:
authorAlex Merry <dev@randomguy3.me.uk>2011-09-01 15:47:31 +0200
committerJunio C Hamano <gitster@pobox.com>2012-03-21 18:02:39 +0100
commit471dcfdbb23ad423168d928335bc36217f9e311d (patch)
treee90fde9dcb6886680985e13bd84f4878f10f1138 /contrib/completion
parentMerge branch 'fc/zsh-completion' (diff)
downloadgit-471dcfdbb23ad423168d928335bc36217f9e311d.tar.xz
git-471dcfdbb23ad423168d928335bc36217f9e311d.zip
contrib/completion: "local var=()" is misinterpreted as func-decl by zsh
Certain versions of zsh seems to treat local var=() as a function declaration, rather than an assignment of an empty array, although its documentation does not suggest that this should be the case. With zsh 4.3.15 on Fedora Core 15, this causes __git_ps1 " (%s)" to trigger an error message: local:2: command not found: svn_url_pattern when GIT_PS1_SHOWUPSTREAM="auto". Signed-off-by: Alex Merry <dev@randomguy3.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d7367e9faa..99fea1db28 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -106,9 +106,10 @@ __gitdir ()
__git_ps1_show_upstream ()
{
local key value
- local svn_remote=() svn_url_pattern count n
+ local svn_remote svn_url_pattern count n
local upstream=git legacy="" verbose=""
+ svn_remote=()
# get some config options from git-config
local output="$(git config -z --get-regexp '^(svn-remote\..*\.url|bash\.showupstream)$' 2>/dev/null | tr '\0\n' '\n ')"
while read -r key value; do