commit 11d7587ef5019e3735f6ec20c43f580eb5c8a94e from: Stefan Sperling date: Sat Jan 04 17:57:01 2020 UTC replace commit graph's head_node pointer with a local variable commit - ee780d5ce8c335e430804438c35eb48564ec0afb commit + 11d7587ef5019e3735f6ec20c43f580eb5c8a94e blob - c4649f5b6f357fc0bf48d47dad38c58b413f3849 blob + 3547daee92b9b6e429ebe95b6bfa67382fe47e83 --- lib/commit_graph.c +++ lib/commit_graph.c @@ -59,9 +59,6 @@ struct got_commit_graph_branch_tip { struct got_commit_graph { /* The set of all commits we have traversed. */ struct got_object_idset *node_ids; - - /* The commit at which traversal began (youngest commit in node_ids). */ - struct got_commit_graph_node *head_node; int flags; #define GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL 0x01 @@ -388,6 +385,7 @@ got_commit_graph_open(struct got_commit_graph **graph, const struct got_error *err = NULL; struct got_commit_object *commit; int changed, branch_done; + struct got_commit_graph_node *node; *graph = NULL; @@ -414,10 +412,10 @@ got_commit_graph_open(struct got_commit_graph **graph, if (first_parent_traversal) (*graph)->flags |= GOT_COMMIT_GRAPH_FIRST_PARENT_TRAVERSAL; - err = add_node(&(*graph)->head_node, &changed, &branch_done, *graph, + err = add_node(&node, &changed, &branch_done, *graph, commit_id, commit, NULL, repo); if (err == NULL) { - err = advance_branch(*graph, (*graph)->head_node, commit_id, + err = advance_branch(*graph, node, commit_id, commit, repo); } got_object_commit_close(commit);