prompt: fix for simple rebase
[gitweb.git] / contrib / completion / git-prompt.sh
index eaf5c369aacde207cbad4c9df9574e7b26634bb7..bbf7657142d9aff8e2b0b7defea49234ce2a13d7 100644 (file)
@@ -279,6 +279,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"
@@ -295,6 +296,7 @@ __git_ps1 ()
                                r="|BISECTING"
                        fi
 
+                       test -n "$b" ||
                        b="$(git symbolic-ref HEAD 2>/dev/null)" || {
                                detached=yes
                                b="$(