Skip to content

Commit 7be13f5

Browse files
peffgitster
authored andcommitted
read_object_file_extended(): drop lookup_replace option
Our sole caller always passes in "1", so we can just drop the parameter entirely. Anybody who doesn't want this behavior could easily call oid_object_info_extended() themselves, as we're just a thin wrapper around it. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 34728d7 commit 7be13f5

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

object-file.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,18 +1698,15 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,
16981698
void *read_object_file_extended(struct repository *r,
16991699
const struct object_id *oid,
17001700
enum object_type *type,
1701-
unsigned long *size,
1702-
int lookup_replace)
1701+
unsigned long *size)
17031702
{
17041703
struct object_info oi = OBJECT_INFO_INIT;
1705-
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT;
1704+
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;
17061705
void *data;
17071706

17081707
oi.typep = type;
17091708
oi.sizep = size;
17101709
oi.contentp = &data;
1711-
if (lookup_replace)
1712-
flags |= OBJECT_INFO_LOOKUP_REPLACE;
17131710
if (oid_object_info_extended(r, oid, &oi, flags))
17141711
return NULL;
17151712

object-store.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ void *map_loose_object(struct repository *r, const struct object_id *oid,
244244
void *read_object_file_extended(struct repository *r,
245245
const struct object_id *oid,
246246
enum object_type *type,
247-
unsigned long *size, int lookup_replace);
247+
unsigned long *size);
248248
static inline void *repo_read_object_file(struct repository *r,
249249
const struct object_id *oid,
250250
enum object_type *type,
251251
unsigned long *size)
252252
{
253-
return read_object_file_extended(r, oid, type, size, 1);
253+
return read_object_file_extended(r, oid, type, size);
254254
}
255255
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
256256
#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)

0 commit comments

Comments
 (0)