From: Phillip Wood Date: Tue, 30 Jun 2026 15:28:59 +0000 (+0100) Subject: sequencer: return early from pick_one_commit() on success X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92d436adddad31b804aef3a9efc971c48d93ab2b;p=thirdparty%2Fgit.git sequencer: return early from pick_one_commit() on success The only block that does not return early is the one guarded by "!res". Move the return into that block to make it clear that after recording the commit as rewritten all we do is return from the function. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- diff --git a/sequencer.c b/sequencer.c index 416729f30a..655a2e84be 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4986,6 +4986,7 @@ static int pick_one_commit(struct repository *r, } else if (!res) { record_in_rewritten(&item->commit->object.oid, peek_command(todo_list, 1)); + return 0; } else if (res && is_fixup(item->command)) { return error_failed_squash(r, item->commit, opts, item->arg_len, arg); @@ -5009,7 +5010,8 @@ static int pick_one_commit(struct repository *r, return error_with_patch(r, item->commit, arg, item->arg_len, opts, res, to_amend); } - return res; + + BUG("Unhandled return value from do_pick_commit()"); } static int pick_commits(struct repository *r,