diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-01 14:22:18 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-01 14:46:35 -0700 |
| commit | 961038856bcd319289a226e29503358123c0a1ba (patch) | |
| tree | 122cadd3dcdc225f4ab3b57da92cce8c51b25cd3 /odb.c | |
| parent | bd52ea343d2af91574fedcf765250f44f3d624d4 (diff) | |
| download | git-961038856bcd319289a226e29503358123c0a1ba.tar.gz | |
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>
Diffstat (limited to 'odb.c')
| -rw-r--r-- | odb.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -946,9 +946,10 @@ int has_object(struct repository *r, const struct object_id *oid, return oid_object_info_extended(r, oid, NULL, object_info_flags) >= 0; } -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) { - enum object_type type = oid_object_info(the_repository, oid, NULL); + enum object_type type = oid_object_info(odb->repo, oid, NULL); if (type < 0) die(_("%s is not a valid object"), oid_to_hex(oid)); if (type != expect) |
