repo_read_object_file(): stop wrapping read_object_file_extended()

The only caller of read_object_file_extended() is the thin wrapper of repo_read_object_file(). Instead of wrapping, let's just rename the inner function and let people call it directly. This cleans up the namespace and reduces confusion. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 7, 2023 at 08:50 UTC 0ba05cf2e0d077bedbc1ee2521b3e5b5dc883250
2 files changed +9 -17
object-file.c
+4 -4
@@ -1695,10 +1695,10 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,
1695 * deal with them should arrange to call oid_object_info_extended() and give
1696 * error messages themselves.
1697 */
1698 -void *read_object_file_extended(struct repository *r,
1699 - const struct object_id *oid,
1700 - enum object_type *type,
1701 - unsigned long *size)
1698 +void *repo_read_object_file(struct repository *r,
1699 + const struct object_id *oid,
1700 + enum object_type *type,
1701 + unsigned long *size)
1702 {
1703 struct object_info oi = OBJECT_INFO_INIT;
1704 unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;
object-store.h
+5 -13
@@ -241,17 +241,10 @@ const char *loose_object_path(struct repository *r, struct strbuf *buf,
241 void *map_loose_object(struct repository *r, const struct object_id *oid,
242 unsigned long *size);
243
244 -void *read_object_file_extended(struct repository *r,
245 - const struct object_id *oid,
246 - enum object_type *type,
247 - unsigned long *size);
248 -static inline void *repo_read_object_file(struct repository *r,
249 - const struct object_id *oid,
250 - enum object_type *type,
251 - unsigned long *size)
252 -{
253 - return read_object_file_extended(r, oid, type, size);
254 -}
244 +void *repo_read_object_file(struct repository *r,
245 + const struct object_id *oid,
246 + enum object_type *type,
247 + unsigned long *size);
248 #ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
249 #define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)
250 #endif
@@ -358,8 +351,7 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect);
351 /*
352 * Enabling the object read lock allows multiple threads to safely call the
353 * following functions in parallel: repo_read_object_file(), read_object_file(),
361 - * read_object_file_extended(), read_object_with_reference(),
362 - * oid_object_info() and oid_object_info_extended().
354 + * read_object_with_reference(), oid_object_info() and oid_object_info_extended().
355 *
356 * obj_read_lock() and obj_read_unlock() may also be used to protect other
357 * section which cannot execute in parallel with object reading. Since the used