odb: get rid of the_repository in assert_oid_type()

Get rid of our dependency on `the_repository` in `assert_oid_type()` by
passing in the object database as a parameter and adjusting all callers.

Rename the function to `odb_assert_oid_type()`.

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:18 +02:00
committed by Junio C Hamano
parent bd52ea343d
commit 961038856b
4 changed files with 7 additions and 5 deletions

3
odb.h
View File

@@ -302,7 +302,8 @@ enum {
int has_object(struct repository *r, const struct object_id *oid,
unsigned flags);
void assert_oid_type(const struct object_id *oid, enum object_type expect);
void odb_assert_oid_type(struct object_database *odb,
const struct object_id *oid, enum object_type expect);
/*
* Enabling the object read lock allows multiple threads to safely call the