odb: rename read_object_with_reference()

Rename `read_object_with_reference()` to `odb_read_object_peeled()` to
match other functions related to the object database and our modern
coding guidelines. Furthermore though, the old name didn't really
describe very well what this function actually does, which is to walk
down any commit and tag objects until an object of the required type has
been found. This is generally referred to as "peeling", so the new name
should be way more descriptive.

No compatibility wrapper is introduced as the function is not used a lot
throughout our codebase.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-07-01 14:22:29 +02:00
committed by Junio C Hamano
parent 08218b8cd4
commit 841a03b404
8 changed files with 37 additions and 45 deletions

View File

@@ -2055,8 +2055,8 @@ static void add_preferred_base(struct object_id *oid)
if (window <= num_preferred_base++)
return;
data = read_object_with_reference(the_repository, oid,
OBJ_TREE, &size, &tree_oid);
data = odb_read_object_peeled(the_repository->objects, oid,
OBJ_TREE, &size, &tree_oid);
if (!data)
return;