Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit 5adb374

Browse files
committed
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
2 parents 72e7192 + 1306321 commit 5adb374

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

contrib/completion/git-prompt.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ __git_ps1 ()
360360
step=$(cat "$g/rebase-apply/next")
361361
total=$(cat "$g/rebase-apply/last")
362362
if [ -f "$g/rebase-apply/rebasing" ]; then
363+
b="$(cat "$g/rebase-apply/head-name")"
363364
r="|REBASE"
364365
elif [ -f "$g/rebase-apply/applying" ]; then
365366
r="|AM"
@@ -376,6 +377,7 @@ __git_ps1 ()
376377
r="|BISECTING"
377378
fi
378379

380+
test -n "$b" ||
379381
b="$(git symbolic-ref HEAD 2>/dev/null)" || {
380382
detached=yes
381383
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)