From: Oswald Buddenhagen Date: Tue, 12 Sep 2023 10:55:41 +0000 (+0200) Subject: sequencer: remove unreachable exit condition in pick_commits() X-Git-Tag: v2.42.1~17^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63642d58b4b28c3caba6d5ab0c3aa98c4ce54eaa;p=thirdparty%2Fgit.git sequencer: remove unreachable exit condition in pick_commits() 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 Acked-by: Phillip Wood Signed-off-by: Junio C Hamano --- diff --git a/sequencer.c b/sequencer.c index 5e0c15a16b..07a8ae75b0 100644 --- a/sequencer.c +++ b/sequencer.c @@ -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;