diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2021-08-12 15:42:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-13 20:36:22 +0200 |
commit | e5ee33e8551fa934862b8cbe50693f4841e7dace (patch) | |
tree | 01f7e3e7b443c0605669166c83bc5409855349f8 /t/t3418-rebase-continue.sh | |
parent | rebase --apply: restore some tests (diff) | |
download | git-e5ee33e8551fa934862b8cbe50693f4841e7dace.tar.xz git-e5ee33e8551fa934862b8cbe50693f4841e7dace.zip |
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/t3418-rebase-continue.sh')
-rwxr-xr-x | t/t3418-rebase-continue.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index bda5e5db80..738fbae9b2 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -31,6 +31,16 @@ test_expect_success 'merge based rebase --continue with works with touched file' git rebase --continue ' +test_expect_success 'merge based rebase --continue removes .git/MERGE_MSG' ' + git checkout -f --detach topic && + + test_must_fail git rebase --onto main HEAD^ && + git read-tree --reset -u HEAD && + test_path_is_file .git/MERGE_MSG && + git rebase --continue && + test_path_is_missing .git/MERGE_MSG +' + test_expect_success 'apply based rebase --continue works with touched file' ' rm -fr .git/rebase-* && git reset --hard && |