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

[PATCH v3] commit-graph: remove a duplicate assignment

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Sep 29, 2019, 00:55 UTC
Message-ID
<20190929005558.733699-1-alexhenrie24@gmail.com>

The variable g was being set to the same value both at the beginning of the function and before the loop. The assignment before the loop was kept because it helps clarify what the loop does, and the redundant assignment at the beginning of the function was removed.

Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commit-graph.c b/commit-graph.c
index 9b02d2c426..d0e1f9e1f2 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1522,7 +1522,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
 
 static void split_graph_merge_strategy(struct write_commit_graph_context *ctx)
 {
-	struct commit_graph *g = ctx->r->objects->commit_graph;
+	struct commit_graph *g;
 	uint32_t num_commits = ctx->commits.nr;
 	uint32_t i;
 
-- 
2.23.0
Next: Junio C Hamano
Message 1 of 3 in “commit-graph: remove a duplicate assignment”
  1. commit-graph: remove a duplicate assignmentAlex Henrie, Sep 29, 2019
  2. Junio C HamanoSep 30, 2019
  3. Alex HenrieSep 30, 2019

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.