diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index d7367e9faa8..99fea1db28f 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