summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2025-08-06 19:38:35 +0200
committerJunio C Hamano <gitster@pobox.com>2025-08-06 11:49:35 -0700
commit4d491ade8f6597904a7b79ff5d34f8524f915ac2 (patch)
treecf38fbe433d59e2a27c10f4193458e19f59af495
parenta1cf0cf13ab3a659ac77b7d749d6e5b11dc0142b (diff)
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>
-rw-r--r--sequencer.c1
-rwxr-xr-xt/t3404-rebase-interactive.sh1
2 files changed, 2 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index 407ee4e90f..7a0b050b15 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2683,6 +2683,7 @@ static int check_merge_commit_insn(enum todo_command command)
return error(_("cannot squash merge commit into another commit"));
case TODO_MERGE:
+ case TODO_DROP:
return 0;
default:
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index ecfc02062c..50f8ca0d3f 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -2249,6 +2249,7 @@ test_expect_success 'non-merge commands reject merge commits' '
edit $oid
fixup $oid
squash $oid
+ drop $oid # acceptable, no advice
EOF
(
set_replace_editor todo &&