summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-27 14:38:16 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-27 14:38:16 -0700
commitc9cae1e28a050f115d7591ce1a68674c2067b54b (patch)
treefba2d3e25ade64bef99f0093a8078c751eb12e84
parentf79467ef364eb06ee9b49344cdec02e2bd1f2cc7 (diff)
parent1306321ebea4d789974f0d58062664cc35c411e8 (diff)
downloadgit-c9cae1e28a050f115d7591ce1a68674c2067b54b.tar.gz
Merge branch 'fc/show-branch-in-rebase-am' into maint
* fc/show-branch-in-rebase-am: prompt: fix for simple rebase
-rw-r--r--contrib/completion/git-prompt.sh2
-rwxr-xr-xt/t9903-bash-prompt.sh2
2 files changed, 3 insertions, 1 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index b6b1534c02..54e48299ae 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -280,6 +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"
@@ -296,6 +297,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 &&