Skip to content

Commit f5facaa

Browse files
ttaylorrgitster
authored andcommitted
commit-graph.c: iteratively verify commit-graph chains
Now that we have a function which can verify a single layer of a commit-graph chain, implement `verify_commit_graph()` in terms of iterating over commit-graphs along their `->base_graph` pointers. This further prepares us to consolidate the progress output of `git commit-graph verify`. Signed-off-by: Taylor Blau <[email protected]> Acked-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent eb319d6 commit f5facaa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

commit-graph.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,10 +2708,11 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
27082708
return 1;
27092709
}
27102710

2711-
local_error = verify_one_commit_graph(r, g, flags);
2712-
2713-
if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW) && g->base_graph)
2714-
local_error |= verify_commit_graph(r, g->base_graph, flags);
2711+
for (; g; g = g->base_graph) {
2712+
local_error |= verify_one_commit_graph(r, g, flags);
2713+
if (flags & COMMIT_GRAPH_VERIFY_SHALLOW)
2714+
break;
2715+
}
27152716

27162717
return local_error;
27172718
}

0 commit comments

Comments
 (0)