object-store: drop `repo_has_object_file()`

In the preceding commits we have converted all users of `repo_has_object_file()` and its `_with_flags()` variant to instead use `has_object()`. Drop these functions. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Apr 29, 2025 at 09:52 UTC 8a9e27be8213ab90ac761d56ac36229ee52c443f
2 files changed -31
object-store.c
-14
@@ -949,20 +949,6 @@ int has_object(struct repository *r, const struct object_id *oid,
949 return oid_object_info_extended(r, oid, NULL, object_info_flags) >= 0;
950 }
951
952 -int repo_has_object_file_with_flags(struct repository *r,
953 - const struct object_id *oid, int flags)
954 -{
955 - if (!startup_info->have_repository)
956 - return 0;
957 - return oid_object_info_extended(r, oid, NULL, flags) >= 0;
958 -}
959 -
960 -int repo_has_object_file(struct repository *r,
961 - const struct object_id *oid)
962 -{
963 - return repo_has_object_file_with_flags(r, oid, 0);
964 -}
965 -
952 void assert_oid_type(const struct object_id *oid, enum object_type expect)
953 {
954 enum object_type type = oid_object_info(the_repository, oid, NULL);
object-store.h
-17
@@ -276,23 +276,6 @@ enum {
276 int has_object(struct repository *r, const struct object_id *oid,
277 unsigned flags);
278
279 -/*
280 - * These macros and functions are deprecated. If checking existence for an
281 - * object that is likely to be missing and/or whose absence is relatively
282 - * inconsequential (or is consequential but the caller is prepared to handle
283 - * it), use has_object(), which has better defaults (no lazy fetch in a partial
284 - * clone and no rechecking of packed storage). In the unlikely event that a
285 - * caller needs to assert existence of an object that it fully expects to
286 - * exist, and wants to trigger a lazy fetch in a partial clone, use
287 - * oid_object_info_extended() with a NULL struct object_info.
288 - *
289 - * These functions can be removed once all callers have migrated to
290 - * has_object() and/or oid_object_info_extended().
291 - */
292 -int repo_has_object_file(struct repository *r, const struct object_id *oid);
293 -int repo_has_object_file_with_flags(struct repository *r,
294 - const struct object_id *oid, int flags);
295 -
279 void assert_oid_type(const struct object_id *oid, enum object_type expect);
280
281 /*