diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2021-08-12 16:42:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-13 21:36:22 +0300 |
commit | e5ee33e8551fa934862b8cbe50693f4841e7dace (patch) | |
tree | 01f7e3e7b443c0605669166c83bc5409855349f8 /t/t3403-rebase-skip.sh | |
parent | bed9b4e3128af2c36645ba44fe19bf10af6d68ea (diff) |
rebase --continue: remove .git/MERGE_MSG
If the user skips the final commit by removing all the changes from
the index and worktree with 'git restore' (or read-tree) and then runs
'git rebase --continue' .git/MERGE_MSG is left behind. This will seed
the commit message the next time the user commits which is not what we
want to happen.
Reported-by: Victor Gambier <vgambier@excilys.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3403-rebase-skip.sh')
-rwxr-xr-x | t/t3403-rebase-skip.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3403-rebase-skip.sh b/t/t3403-rebase-skip.sh index a44e68d0ff..f6e4864497 100755 --- a/t/t3403-rebase-skip.sh +++ b/t/t3403-rebase-skip.sh @@ -20,6 +20,7 @@ test_expect_success setup ' git add hello && git commit -m "hello" && git branch skip-reference && + git tag hello && echo world >> hello && git commit -a -m "hello world" && @@ -96,6 +97,13 @@ test_expect_success 'moved back to branch correctly' ' test_debug 'gitk --all & sleep 1' +test_expect_success 'skipping final pick removes .git/MERGE_MSG' ' + test_must_fail git rebase --onto hello reverted-goodbye^ \ + reverted-goodbye && + git rebase --skip && + test_path_is_missing .git/MERGE_MSG +' + test_expect_success 'correct advice upon picking empty commit' ' test_when_finished "git rebase --abort" && test_must_fail git rebase -i --onto goodbye \ |