]> git.ipfire.org Git - thirdparty/git.git/commit
pack-objects: extract `record_tree_depth()` helper
authorTaylor Blau <me@ttaylorr.com>
Sun, 21 Jun 2026 23:03:07 +0000 (19:03 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Jun 2026 23:26:14 +0000 (16:26 -0700)
commit264efee401e04de50055d1519dda1fbd1e02428f
tree8b147a4002859f1a9ad3e80566523600b27b824d
parent0a374511064bad27f707cb9f03448fb8aa25791f
pack-objects: extract `record_tree_depth()` helper

Prepare for a subsequent change that needs to record tree depths from a
second call site by factoring the delta-islands tree-depth bookkeeping
out of `show_object()` and into a helper, `record_tree_depth()`.

The helper looks up the object in `to_pack`, returns early when the
object was not added there, computes the depth from the slash count in
the supplied name, and preserves the existing max-depth-wins behavior
when a tree is reached by more than one path.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/pack-objects.c