rebase -i: permit 'drop' of a merge commit
4c063c82e9 (rebase -i: improve error message when picking merge, 2024-05-30) added advice texts for cases when a merge commit is passed as argument of sequencer command that cannot operate with a merge commit. However, it forgot about the 'drop' command, so that in this case the BUG() in the default branch is reached. Handle 'drop' like 'merge', i.e., permit it without a message. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Aug 6, 2025 at 19:38 UTC
4d491ade8f6597904a7b79ff5d34f8524f915ac2
2 files changed
+2
sequencer.c
+1
@@ -2683,6 +2683,7 @@ static int check_merge_commit_insn(enum todo_command command)
2683
return error(_("cannot squash merge commit into another commit"));
2684
2685
case TODO_MERGE:
2686
+ case TODO_DROP:
2687
return 0;
2688
2689
default:
t/t3404-rebase-interactive.sh
+1
@@ -2249,6 +2249,7 @@ test_expect_success 'non-merge commands reject merge commits' '
2249
edit $oid
2250
fixup $oid
2251
squash $oid
2252
+ drop $oid # acceptable, no advice
2253
EOF
2254
(
2255
set_replace_editor todo &&