Merge branch 'sg/prompt-svn-remote-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2013 17:43:38 +0000 (10:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Oct 2013 17:43:38 +0000 (10:43 -0700)
Bash portability fix.

* sg/prompt-svn-remote-fix:
bash prompt: don't use '+=' operator in show upstream code path

1  2 
contrib/completion/git-prompt.sh
index 202e2e520f42059c308f196e0c5022c3dbb4a142,998722cf7f5d65639654f9f7e74f4c2b3d5452f3..7b732d2aeba0e3bca3b42d28f2f8f5730a08ccee
@@@ -60,7 -60,6 +60,7 @@@
  # of values:
  #
  #     verbose       show number of commits ahead/behind (+/-) upstream
 +#     name          if verbose, then also show the upstream abbrev name
  #     legacy        don't use the '--count' option available in recent
  #                   versions of git-rev-list
  #     git           always compare HEAD to @{upstream}
@@@ -95,7 -94,7 +95,7 @@@ __git_ps1_show_upstream (
  {
        local key value
        local svn_remote svn_url_pattern count n
 -      local upstream=git legacy="" verbose=""
 +      local upstream=git legacy="" verbose="" name=""
  
        svn_remote=()
        # get some config options from git-config
                        ;;
                svn-remote.*.url)
                        svn_remote[$((${#svn_remote[@]} + 1))]="$value"
-                       svn_url_pattern+="\\|$value"
+                       svn_url_pattern="$svn_url_pattern\\|$value"
                        upstream=svn+git # default upstream is SVN if available, else git
                        ;;
                esac
                git|svn) upstream="$option" ;;
                verbose) verbose=1 ;;
                legacy)  legacy=1  ;;
 +              name)    name=1 ;;
                esac
        done
  
                *)          # diverged from upstream
                        p=" u+${count#* }-${count%      *}" ;;
                esac
 +              if [[ -n "$count" && -n "$name" ]]; then
 +                      p="$p $(git rev-parse --abbrev-ref "$upstream" 2>/dev/null)"
 +              fi
        fi
  
  }