prompt: fix for simple rebase

When we are rebasing without options ('am' mode), the head rebased lives in '$g/rebase-apply/head-name', so lets use that information so it's reported the same way as if we were doing other rebases (-i or -m). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed May 29, 2013 at 01:21 UTC 1306321ebea4d789974f0d58062664cc35c411e8
2 files changed +3 -1
contrib/completion/git-prompt.sh
+2
@@ -279,6 +279,7 @@ __git_ps1 ()
279 step=$(cat "$g/rebase-apply/next")
280 total=$(cat "$g/rebase-apply/last")
281 if [ -f "$g/rebase-apply/rebasing" ]; then
282 + b="$(cat "$g/rebase-apply/head-name")"
283 r="|REBASE"
284 elif [ -f "$g/rebase-apply/applying" ]; then
285 r="|AM"
@@ -295,6 +296,7 @@ __git_ps1 ()
296 r="|BISECTING"
297 fi
298
299 + test -n "$b" ||
300 b="$(git symbolic-ref HEAD 2>/dev/null)" || {
301 detached=yes
302 b="$(
t/t9903-bash-prompt.sh
+1 -1
@@ -276,7 +276,7 @@ test_expect_success 'prompt - rebase merge' '
276 '
277
278 test_expect_success 'prompt - rebase' '
279 - printf " ((t2)|REBASE 1/3)" > expected &&
279 + printf " (b2|REBASE 1/3)" > expected &&
280 git checkout b2 &&
281 test_when_finished "git checkout master" &&
282 test_must_fail git rebase b1 b2 &&