Skip to content

Commit c9cae1e

Browse files
committed
Merge branch 'fc/show-branch-in-rebase-am' into maint
* fc/show-branch-in-rebase-am: prompt: fix for simple rebase
2 parents f79467e + 1306321 commit c9cae1e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

contrib/completion/git-prompt.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ __git_ps1 ()
280280
step=$(cat "$g/rebase-apply/next")
281281
total=$(cat "$g/rebase-apply/last")
282282
if [ -f "$g/rebase-apply/rebasing" ]; then
283+
b="$(cat "$g/rebase-apply/head-name")"
283284
r="|REBASE"
284285
elif [ -f "$g/rebase-apply/applying" ]; then
285286
r="|AM"
@@ -296,6 +297,7 @@ __git_ps1 ()
296297
r="|BISECTING"
297298
fi
298299

300+
test -n "$b" ||
299301
b="$(git symbolic-ref HEAD 2>/dev/null)" || {
300302
detached=yes
301303
b="$(

t/t9903-bash-prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ test_expect_success 'prompt - rebase merge' '
276276
'
277277

278278
test_expect_success 'prompt - rebase' '
279-
printf " ((t2)|REBASE 1/3)" > expected &&
279+
printf " (b2|REBASE 1/3)" > expected &&
280280
git checkout b2 &&
281281
test_when_finished "git checkout master" &&
282282
test_must_fail git rebase b1 b2 &&

0 commit comments

Comments
 (0)