Merge branch 'fc/show-branch-in-rebase-am' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Jun 2013 21:38:16 +0000 (14:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jun 2013 21:38:16 +0000 (14:38 -0700)
* fc/show-branch-in-rebase-am:
prompt: fix for simple rebase

1  2 
contrib/completion/git-prompt.sh
index b6b1534c0287dadb7d3e47051fd892debf69e6b3,bbf7657142d9aff8e2b0b7defea49234ce2a13d7..54e48299ae795b7a3a50cf09f850faa16b87e692
@@@ -124,7 -124,7 +124,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
                        ;;
        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
@@@ -280,6 -279,7 +280,7 @@@ __git_ps1 (
                                step=$(cat "$g/rebase-apply/next")
                                total=$(cat "$g/rebase-apply/last")
                                if [ -f "$g/rebase-apply/rebasing" ]; then
+                                       b="$(cat "$g/rebase-apply/head-name")"
                                        r="|REBASE"
                                elif [ -f "$g/rebase-apply/applying" ]; then
                                        r="|AM"
                                r="|BISECTING"
                        fi
  
+                       test -n "$b" ||
                        b="$(git symbolic-ref HEAD 2>/dev/null)" || {
                                detached=yes
                                b="$(