Commit 90e777f1 authored by Stefan Beller's avatar Stefan Beller Committed by Junio C Hamano

replace-object: allow lookup_replace_object to handle arbitrary repositories

Signed-off-by: Stefan Beller's avatarStefan Beller <sbeller@google.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 5643557e
......@@ -23,14 +23,14 @@ extern const struct object_id *do_lookup_replace_object(struct repository *r,
* either sha1 or a pointer to a permanently-allocated value. When
* object replacement is suppressed, always return sha1.
*/
#define lookup_replace_object(r, s) lookup_replace_object_##r(s)
static inline const struct object_id *lookup_replace_object_the_repository(const struct object_id *oid)
static inline const struct object_id *lookup_replace_object(struct repository *r,
const struct object_id *oid)
{
if (!check_replace_refs ||
(the_repository->objects->replace_map &&
the_repository->objects->replace_map->map.tablesize == 0))
(r->objects->replace_map &&
r->objects->replace_map->map.tablesize == 0))
return oid;
return do_lookup_replace_object(the_repository, oid);
return do_lookup_replace_object(r, oid);
}
#endif /* REPLACE_OBJECT_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment