]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph.c: extract `verify_one_commit_graph()`
authorTaylor Blau <me@ttaylorr.com>
Sat, 8 Jul 2023 00:31:36 +0000 (20:31 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jul 2023 17:02:41 +0000 (10:02 -0700)
commiteb319d6771f5829dc26499af93050350083adc7d
treecea891f99adb3e93edbf32a239bd2ef7beb2bb87
parent39bdd30377c18cf52da08441bb2cf2a354f0e5bb
commit-graph.c: extract `verify_one_commit_graph()`

When the `verify_commit_graph()` function was extended to support
commit-graph chains via 3da4b609bb1 (commit-graph: verify chains with
--shallow mode, 2019-06-18), it did so by recursively calling itself on
each layer of the commit-graph chain.

In practice this poses no issues, since commit-graph chains do not loop,
and there are few enough of them that adding additional frames to the
stack is not a problem.

A future commit will consolidate the progress output from `git
commit-graph verify` when verifying chained commit-graphs to print a
single line instead of one progress meter per commit-graph layer.
Prepare for this by extracting a routine to verify a single layer of a
commit-graph.

Note that `verify_commit_graph()` is still recursive after this patch,
but this will change in the subsequent patch.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Acked-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c