git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] sequencer: remove unreachable exit condition in pick_commits()

From
Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Date
Sep 12, 2023, 10:55 UTC
Message-ID
<20230912105541.272917-1-oswald.buddenhagen@gmx.de>
In-Reply-To
<ddf8dc95-6583-4257-b48a-0115f59950ef@gmail.com>

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>
---
v2:
- improved commit message
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: Phillip Wood <phillip.wood123@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>
---
 sequencer.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index a66dcf8ab2..99e9c520ca 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -4832,10 +4832,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;
-- 
2.42.0.419.g70bf8a5751
Previous: Phillip WoodNext: Phillip Wood
Message 3 of 5 in “sequencer: remove unreachable exit condition in pick_commits()”
  1. sequencer: remove unreachable exit condition in pick_commits()Oswald Buddenhagen, Sep 3, 2023
  2. Phillip WoodSep 12, 2023
  3. sequencer: remove unreachable exit condition in pick_commits()Oswald Buddenhagen, Sep 12, 2023
  4. Phillip WoodSep 12, 2023
  5. Junio C HamanoSep 13, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.