sequencer: simplify handling of fixup with conflicts

Commit e032abd5a0 (rebase: fix rewritten list for failed pick, 2023-09-06) introduced an early return when res == -1, so if we enter this conditional block then res is positive. After the last couple of commits the only possible positive value is 1. That means we can simplify the code by removing the conditional call to intend_to_amend() and have error_failed_squash() request that it is called in error_with_patch() instead. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Phillip Wood committed Jul 15, 2026 at 16:21 UTC dc0e2ac15dc5c3770b2117535a0b316e3bf6aa7a
1 file changed +1 -3
sequencer.c
+1 -3
@@ -3874,7 +3874,7 @@ static int error_failed_squash(struct repository *r,
3874 return error(_("could not copy '%s' to '%s'"),
3875 rebase_path_message(),
3876 git_path_merge_msg(r));
3877 - return error_with_patch(r, commit, subject, subject_len, opts, 1, 0);
3877 + return error_with_patch(r, commit, subject, subject_len, opts, 1, 1);
3878 }
3879
3880 static int do_exec(struct repository *r, const char *command_line, int quiet)
@@ -4986,8 +4986,6 @@ static int pick_one_commit(struct repository *r,
4986 record_in_rewritten(&item->commit->object.oid,
4987 peek_command(todo_list, 1));
4988 if (res && is_fixup(item->command)) {
4989 - if (res == 1)
4990 - intend_to_amend();
4989 return error_failed_squash(r, item->commit, opts,
4990 item->arg_len, arg);
4991 } else if (res && is_rebase_i(opts) && item->commit) {