diff options
| author | Patrick Steinhardt <ps@pks.im> | 2026-03-20 08:07:36 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-20 13:16:42 -0700 |
| commit | 67f47eab61c3a2c14f2d0351c3844f12fbd95dd2 (patch) | |
| tree | f3dce10b05594045a6aa3f34a816e70991e02022 /commit-reach.c | |
| parent | e9b7caa1b14bc1fe825b216941a0655d6afdffe5 (diff) | |
| download | git-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 'commit-reach.c')
0 files changed, 0 insertions, 0 deletions
