void *read_object_file_extended(struct repository *r,
const struct object_id *oid,
enum object_type *type,
- unsigned long *size,
- int lookup_replace)
+ unsigned long *size)
{
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;
oi.typep = type;
oi.sizep = size;
oi.contentp = &data;
- if (lookup_replace)
- flags |= OBJECT_INFO_LOOKUP_REPLACE;
if (oid_object_info_extended(r, oid, &oi, flags))
return NULL;
void *read_object_file_extended(struct repository *r,
const struct object_id *oid,
enum object_type *type,
- unsigned long *size, int lookup_replace);
+ unsigned long *size);
static inline void *repo_read_object_file(struct repository *r,
const struct object_id *oid,
enum object_type *type,
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
#define read_object_file(oid, type, size) repo_read_object_file(the_repository, oid, type, size)