mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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:
committed by
Junio C Hamano
parent
d4ff88aee3
commit
fcf8e3e111
6
odb.c
6
odb.c
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user