Skip to content

Commit 0ba05cf

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7be13f5 commit 0ba05cf

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

object-file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,10 +1695,10 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,
16951695
* deal with them should arrange to call oid_object_info_extended() and give
16961696
* error messages themselves.
16971697
*/
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)
17021702
{
17031703
struct object_info oi = OBJECT_INFO_INIT;
17041704
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;

object-store.h

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,10 @@ const char *loose_object_path(struct repository *r, struct strbuf *buf,
241241
void *map_loose_object(struct repository *r, const struct object_id *oid,
242242
unsigned long *size);
243243

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);
255248
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
256249
#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)
257250
#endif
@@ -358,8 +351,7 @@ void assert_oid_type(const struct object_id *oid, enum object_type expect);
358351
/*
359352
* Enabling the object read lock allows multiple threads to safely call the
360353
* 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().
363355
*
364356
* obj_read_lock() and obj_read_unlock() may also be used to protect other
365357
* section which cannot execute in parallel with object reading. Since the used

0 commit comments

Comments
 (0)