aboutsummaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2026-03-20 08:07:34 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-20 13:16:42 -0700
commiteac58debd9f61391a61b832e3cee349a20bd2c4a (patch)
treef99e6f89881bd890b928d0452d587fc4314601e9 /commit.h
parentd2612fe59e605102cb422fadbb0cb8bea499daee (diff)
downloadgit-eac58debd9f61391a61b832e3cee349a20bd2c4a.tar.xz
object-name: backend-generic `get_short_oid()`
The function `get_short_oid()` takes as input an abbreviated object ID and tries to turn that object ID into the full object ID. This is done by iterating through all objects that have the user-provided prefix. If that yields exactly one object we know that the abbreviated object ID is unambiguous, otherwise it is ambiguous and we print the list of objects that match the prefix. We iterate through all objects with the given prefix by calling both `find_short_packed_object()` and `find_short_object_filename()`, which is of course specific to the "files" backend. But we now have a generic way to iterate through objects with a specific prefix. Refactor the code to use `odb_for_each_object()` instead so that it works with object backends different than the "files" backend. Remove the now-unused `find_short_packed_object()` function. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions