]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase -i: permit 'drop' of a merge commit
authorJohannes Sixt <j6t@kdbg.org>
Wed, 6 Aug 2025 17:38:35 +0000 (19:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Aug 2025 18:49:35 +0000 (11:49 -0700)
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>
sequencer.c
t/t3404-rebase-interactive.sh

index 407ee4e90fea685a53504265ce528cb3b8443330..7a0b050b15112203eae7640e2d4a11820f7e24a3 100644 (file)
@@ -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:
index ecfc02062cd046d7121b7cc8535f3d91034eaf59..50f8ca0d3fe20928562f1516e54965eef69c72bd 100755 (executable)
@@ -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 &&