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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
34728d7f30
commit
7be13f5f74
@ -1698,18 +1698,15 @@ int pretend_object_file(void *buf, unsigned long len, enum object_type type,
|
|||||||
void *read_object_file_extended(struct repository *r,
|
void *read_object_file_extended(struct repository *r,
|
||||||
const struct object_id *oid,
|
const struct object_id *oid,
|
||||||
enum object_type *type,
|
enum object_type *type,
|
||||||
unsigned long *size,
|
unsigned long *size)
|
||||||
int lookup_replace)
|
|
||||||
{
|
{
|
||||||
struct object_info oi = OBJECT_INFO_INIT;
|
struct object_info oi = OBJECT_INFO_INIT;
|
||||||
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT;
|
unsigned flags = OBJECT_INFO_DIE_IF_CORRUPT | OBJECT_INFO_LOOKUP_REPLACE;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
oi.typep = type;
|
oi.typep = type;
|
||||||
oi.sizep = size;
|
oi.sizep = size;
|
||||||
oi.contentp = &data;
|
oi.contentp = &data;
|
||||||
if (lookup_replace)
|
|
||||||
flags |= OBJECT_INFO_LOOKUP_REPLACE;
|
|
||||||
if (oid_object_info_extended(r, oid, &oi, flags))
|
if (oid_object_info_extended(r, oid, &oi, flags))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -244,13 +244,13 @@ void *map_loose_object(struct repository *r, const struct object_id *oid,
|
|||||||
void *read_object_file_extended(struct repository *r,
|
void *read_object_file_extended(struct repository *r,
|
||||||
const struct object_id *oid,
|
const struct object_id *oid,
|
||||||
enum object_type *type,
|
enum object_type *type,
|
||||||
unsigned long *size, int lookup_replace);
|
unsigned long *size);
|
||||||
static inline void *repo_read_object_file(struct repository *r,
|
static inline void *repo_read_object_file(struct repository *r,
|
||||||
const struct object_id *oid,
|
const struct object_id *oid,
|
||||||
enum object_type *type,
|
enum object_type *type,
|
||||||
unsigned long *size)
|
unsigned long *size)
|
||||||
{
|
{
|
||||||
return read_object_file_extended(r, oid, type, size, 1);
|
return read_object_file_extended(r, oid, type, size);
|
||||||
}
|
}
|
||||||
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
|
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
|
||||||
#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)
|
#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)
|
||||||
|
Reference in New Issue
Block a user