]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: move definition of is_final_fixup()
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 30 Jun 2026 15:28:52 +0000 (16:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jun 2026 19:03:13 +0000 (12:03 -0700)
Move this function earlier in the file in preparation for adding a
new caller in a later commit.

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

index 57855b0066ac98646facc3b3a610248b5d80a28f..32a09b6e87da5b3ad93c8d808a22d8d6fc34575e 100644 (file)
@@ -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"