From: Phillip Wood Date: Tue, 30 Jun 2026 15:28:52 +0000 (+0100) Subject: sequencer: move definition of is_final_fixup() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe6610fcc013f1ff1a77174b28ea1d5900ae7c59;p=thirdparty%2Fgit.git sequencer: move definition of is_final_fixup() Move this function earlier in the file in preparation for adding a new caller in a later commit. Signed-off-by: Phillip Wood Signed-off-by: Junio C Hamano --- diff --git a/sequencer.c b/sequencer.c index 57855b0066..32a09b6e87 100644 --- a/sequencer.c +++ b/sequencer.c @@ -4629,21 +4629,6 @@ static int do_update_refs(struct repository *r, int quiet) return res; } -static int is_final_fixup(struct todo_list *todo_list) -{ - int i = todo_list->current; - - if (!is_fixup(todo_list->items[i].command)) - return 0; - - while (++i < todo_list->nr) - if (is_fixup(todo_list->items[i].command)) - return 0; - else if (!is_noop(todo_list->items[i].command)) - break; - return 1; -} - static enum todo_command peek_command(struct todo_list *todo_list, int offset) { int i; @@ -4927,6 +4912,21 @@ static int reread_todo_if_changed(struct repository *r, return 0; } +static int is_final_fixup(struct todo_list *todo_list) +{ + int i = todo_list->current; + + if (!is_fixup(todo_list->items[i].command)) + return 0; + + while (++i < todo_list->nr) + if (is_fixup(todo_list->items[i].command)) + return 0; + else if (!is_noop(todo_list->items[i].command)) + break; + return 1; +} + static const char rescheduled_advice[] = N_("Could not execute the todo command\n" "\n"