rebase -p -i: handle "no changes" gracefully
Since commit 376ccb8cbb
(rebase -i: style
fixes and minor cleanups), unchanged SHA-1s are no longer mapped via
$REWRITTEN. But the updating phase was not prepared for the old head
not being rewritten.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
77680caadb
commit
34454e858d
@ -184,6 +184,12 @@ test_expect_success 'retain authorship when squashing' '
|
||||
git show HEAD | grep "^Author: Twerp Snog"
|
||||
'
|
||||
|
||||
test_expect_success '-p handles "no changes" gracefully' '
|
||||
HEAD=$(git rev-parse HEAD) &&
|
||||
git rebase -i -p HEAD^ &&
|
||||
test $HEAD = $(git rev-parse HEAD)
|
||||
'
|
||||
|
||||
test_expect_success 'preserve merges with -p' '
|
||||
git checkout -b to-be-preserved master^ &&
|
||||
: > unrelated-file &&
|
||||
|
Reference in New Issue
Block a user