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 <me@ttaylorr.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Taylor Blau 2023-07-07 20:31:39 -04:00 committed by Junio C Hamano
parent eb319d6771
commit f5facaa465
1 changed files with 5 additions and 4 deletions

View File

@ -2708,10 +2708,11 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g, int flags)
return 1; return 1;
} }


local_error = verify_one_commit_graph(r, g, flags); for (; g; g = g->base_graph) {

local_error |= verify_one_commit_graph(r, g, flags);
if (!(flags & COMMIT_GRAPH_VERIFY_SHALLOW) && g->base_graph) if (flags & COMMIT_GRAPH_VERIFY_SHALLOW)
local_error |= verify_commit_graph(r, g->base_graph, flags); break;
}


return local_error; return local_error;
} }