odb: rename has_object()

Rename `has_object()` to `odb_has_object()` to match other functions
related to the object database and our modern coding guidelines.

Introduce a compatibility wrapper 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:27 +02:00
committed by Junio C Hamano
parent d4ff88aee3
commit fcf8e3e111
30 changed files with 87 additions and 74 deletions

6
odb.c
View File

@@ -871,7 +871,7 @@ int pretend_object_file(struct repository *repo,
char *co_buf;
hash_object_file(repo->hash_algo, buf, len, type, oid);
if (has_object(repo, oid, 0) ||
if (odb_has_object(repo->objects, oid, 0) ||
find_cached_object(repo->objects, oid))
return 0;
@@ -953,7 +953,7 @@ void *read_object_with_reference(struct repository *r,
}
}
int has_object(struct repository *r, const struct object_id *oid,
int odb_has_object(struct object_database *odb, const struct object_id *oid,
unsigned flags)
{
unsigned object_info_flags = 0;
@@ -965,7 +965,7 @@ int has_object(struct repository *r, const struct object_id *oid,
if (!(flags & HAS_OBJECT_FETCH_PROMISOR))
object_info_flags |= OBJECT_INFO_SKIP_FETCH_OBJECT;
return odb_read_object_info_extended(r->objects, oid, NULL, object_info_flags) >= 0;
return odb_read_object_info_extended(odb, oid, NULL, object_info_flags) >= 0;
}
void odb_assert_oid_type(struct object_database *odb,