]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: never reschedule on failed commit
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Tue, 30 Jun 2026 15:28:54 +0000 (16:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 30 Jun 2026 19:03:14 +0000 (12:03 -0700)
If "git commit" fails to run then run_git_commit() returns -1 which
causes the current command to be rescheduled. This is incorrect as
we have successfully picked the commit and have written all the state
files we need to successfully commit when the user continues. Fix this
by converting -1 to 1 which matches what do_merge() does.

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

index e6626c4db4e61c3f2b4a6fd6a23734c0038abc5c..d7e439b1feb38353cefa1c3ea7a594250a9bc3e7 100644 (file)
@@ -2542,6 +2542,12 @@ fast_forward_edit:
                        res = run_git_commit(NULL, reflog_action, opts, flags);
                        *check_todo = 1;
                }
+               /*
+                * If "git commit" failed to run than res == -1 but we dont
+                * want reschedule the last command because the picking the
+                * commit was successful.
+                */
+               res = !!res;
        }