summaryrefslogtreecommitdiff
path: root/t/t3418-rebase-continue.sh
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2021-08-12 13:42:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-08-13 18:36:22 (GMT)
commite5ee33e8551fa934862b8cbe50693f4841e7dace (patch)
tree01f7e3e7b443c0605669166c83bc5409855349f8 /t/t3418-rebase-continue.sh
parentbed9b4e3128af2c36645ba44fe19bf10af6d68ea (diff)
downloadgit-e5ee33e8551fa934862b8cbe50693f4841e7dace.zip
git-e5ee33e8551fa934862b8cbe50693f4841e7dace.tar.gz
git-e5ee33e8551fa934862b8cbe50693f4841e7dace.tar.bz2
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-xt/t3418-rebase-continue.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index bda5e5d..738fbae 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 &&