]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: remove unreachable exit condition in pick_commits()
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Tue, 12 Sep 2023 10:55:41 +0000 (12:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Sep 2023 00:32:09 +0000 (17:32 -0700)
This was introduced by 56dc3ab04 ("sequencer (rebase -i): implement the
'edit' command", 2017-01-02), and was pointless from the get-go: all
early exits from the loop above are returns, so todo_list->current ==
todo_list->nr is an invariant after the loop.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c

index 5e0c15a16b73b3bf04fc76afc2bc2bd1c15f677d..07a8ae75b0a6b6dcf3604dad792299777ddb5cc3 100644 (file)
@@ -4823,10 +4823,6 @@ static int pick_commits(struct repository *r,
                struct strbuf head_ref = STRBUF_INIT, buf = STRBUF_INIT;
                struct stat st;
 
-               /* Stopped in the middle, as planned? */
-               if (todo_list->current < todo_list->nr)
-                       return 0;
-
                if (read_oneliner(&head_ref, rebase_path_head_name(), 0) &&
                                starts_with(head_ref.buf, "refs/")) {
                        const char *msg;