From: Junio C Hamano Date: Thu, 6 Jun 2013 19:18:41 +0000 (-0700) Subject: Merge branch 'fc/show-branch-in-rebase-am' X-Git-Tag: v1.8.4-rc0~204 X-Git-Url: https://www.git.lorimer.id.au/gitweb.git/diff_plain/5adb37410198bc1d2413df9100bfd5c9f5d844f2?hp=72e719292d5dd6e037fecbc3a1c5e4d4f21f03b8 Merge branch 'fc/show-branch-in-rebase-am' The bash prompt code (in contrib/) displayed the name of the branch being rebased when "rebase -i/-m/-p" modes are in use, but not the plain vanilla "rebase". * fc/show-branch-in-rebase-am: prompt: fix for simple rebase --- diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index 9f4e6a368c..86a4f3fa49 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -360,6 +360,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" @@ -376,6 +377,7 @@ __git_ps1 () r="|BISECTING" fi + test -n "$b" || b="$(git symbolic-ref HEAD 2>/dev/null)" || { detached=yes b="$( diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh index 083b319ed1..15521cc4f9 100755 --- a/t/t9903-bash-prompt.sh +++ b/t/t9903-bash-prompt.sh @@ -276,7 +276,7 @@ test_expect_success 'prompt - rebase merge' ' ' test_expect_success 'prompt - rebase' ' - printf " ((t2)|REBASE 1/3)" > expected && + printf " (b2|REBASE 1/3)" > expected && git checkout b2 && test_when_finished "git checkout master" && test_must_fail git rebase b1 b2 &&