odb: rename oid_object_info()

Rename `oid_object_info()` to `odb_read_object_info()` as well as their
`_extended()` variant to match other functions related to the object
database and our modern coding guidelines.

Introduce compatibility wrappers so that any in-flight topics will
continue to compile.

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:25 +02:00
committed by Junio C Hamano
parent 16cf749496
commit e989dd96b8
48 changed files with 213 additions and 170 deletions

View File

@@ -1756,8 +1756,8 @@ static void insert_object_entry(struct mark_set **s, struct object_id *oid, uint
struct object_entry *e;
e = find_object(oid);
if (!e) {
enum object_type type = oid_object_info(the_repository,
oid, NULL);
enum object_type type = odb_read_object_info(the_repository->objects,
oid, NULL);
if (type < 0)
die("object not found: %s", oid_to_hex(oid));
e = insert_object(oid);
@@ -2416,8 +2416,8 @@ static void file_change_m(const char *p, struct branch *b)
enum object_type expected = S_ISDIR(mode) ?
OBJ_TREE: OBJ_BLOB;
enum object_type type = oe ? oe->type :
oid_object_info(the_repository, &oid,
NULL);
odb_read_object_info(the_repository->objects,
&oid, NULL);
if (type < 0)
die("%s not found: %s",
S_ISDIR(mode) ? "Tree" : "Blob",
@@ -2553,7 +2553,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
die("Not a blob (actually a %s): %s",
type_name(oe->type), command_buf.buf);
} else if (!is_null_oid(&oid)) {
enum object_type type = oid_object_info(the_repository, &oid,
enum object_type type = odb_read_object_info(the_repository->objects, &oid,
NULL);
if (type < 0)
die("Blob not found: %s", command_buf.buf);
@@ -2895,7 +2895,8 @@ static void parse_new_tag(const char *arg)
} else if (!repo_get_oid(the_repository, from, &oid)) {
struct object_entry *oe = find_object(&oid);
if (!oe) {
type = oid_object_info(the_repository, &oid, NULL);
type = odb_read_object_info(the_repository->objects,
&oid, NULL);
if (type < 0)
die("Not a valid object: %s", from);
} else
@@ -3085,8 +3086,8 @@ static struct object_entry *dereference(struct object_entry *oe,
const unsigned hexsz = the_hash_algo->hexsz;
if (!oe) {
enum object_type type = oid_object_info(the_repository, oid,
NULL);
enum object_type type = odb_read_object_info(the_repository->objects,
oid, NULL);
if (type < 0)
die("object not found: %s", oid_to_hex(oid));
/* cache it! */