aboutsummaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-20 08:07:36 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-20 13:16:42 -0700
commit67f47eab61c3a2c14f2d0351c3844f12fbd95dd2 (patch)
treef3dce10b05594045a6aa3f34a816e70991e02022 /builtin/pack-objects.c
parente9b7caa1b14bc1fe825b216941a0655d6afdffe5 (diff)
downloadgit-67f47eab61c3a2c14f2d0351c3844f12fbd95dd2.tar.xz
object-name: abbreviate loose object names without `disambiguate_state`
The function `find_short_object_filename()` takes an object ID and computes the minimum required object name length to make it unique. This is done by reusing the object disambiguation infrastructure, where we iterate through every loose object and then update the disambiguate state one by one. Ultimately, we don't care about the disambiguate state though. It is used because this infrastructure knows how to enumerate only those objects that match a given prefix. But now that we have extended the `odb_for_each_object()` function to do this for us we have an easier way to do this. Consequently, we really only use the disambiguate state now to propagate `struct min_abbrev_data`. Refactor the code and drop this indirection so that we use `struct min_abbrev_data` directly. This also allows us to drop some now-unused logic from the disambiguate infrastructure. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pack-objects.c')
0 files changed, 0 insertions, 0 deletions