]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: remove unnecessary condition in pick_one_commit()
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 15 Jul 2026 15:22:00 +0000 (16:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Jul 2026 19:16:21 +0000 (12:16 -0700)
item->commit holds the commit to be picked and so it must be non-NULL
otherwise pick_one_commit() would not know which commit to pick.
It is also unconditionally dereferenced in do_pick_commit() which is
called at the top of this function. Therefore the check to see if it
is non-NULL is superfluous.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c

index a00e3622c87d0d004b1c86b6d2347f239ea01310..8f3eed205e7c7e54d16f12b1e4f130b9e2f3d2c9 100644 (file)
@@ -4988,7 +4988,7 @@ static int pick_one_commit(struct repository *r,
        if (res && is_fixup(item->command)) {
                return error_failed_squash(r, item->commit, opts,
                                           item->arg_len, arg);
-       } else if (res && is_rebase_i(opts) && item->commit) {
+       } else if (res && is_rebase_i(opts)) {
                int to_amend = 0;
                struct object_id oid;