Skip to content

Commit 4d491ad

Browse files
j6tgitster
authored andcommitted
rebase -i: permit 'drop' of a merge commit
4c063c8 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a1cf0cf commit 4d491ad

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sequencer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,6 +2683,7 @@ static int check_merge_commit_insn(enum todo_command command)
26832683
return error(_("cannot squash merge commit into another commit"));
26842684

26852685
case TODO_MERGE:
2686+
case TODO_DROP:
26862687
return 0;
26872688

26882689
default:

t/t3404-rebase-interactive.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,6 +2249,7 @@ test_expect_success 'non-merge commands reject merge commits' '
22492249
edit $oid
22502250
fixup $oid
22512251
squash $oid
2252+
drop $oid # acceptable, no advice
22522253
EOF
22532254
(
22542255
set_replace_editor todo &&

0 commit comments

Comments
 (0)