1#ifndef REPLACE_OBJECT_H 2#define REPLACE_OBJECT_H 3 4#include"oidmap.h" 5#include"repository.h" 6#include"object-store.h" 7 8struct replace_object { 9struct oidmap_entry original; 10struct object_id replacement; 11}; 12 13/* 14 * This internal function is only declared here for the benefit of 15 * lookup_replace_object(). Please do not call it directly. 16 */ 17externconst struct object_id *do_lookup_replace_object(struct repository *r, 18const struct object_id *oid); 19 20/* 21 * If object sha1 should be replaced, return the replacement object's 22 * name (replaced recursively, if necessary). The return value is 23 * either sha1 or a pointer to a permanently-allocated value. When 24 * object replacement is suppressed, always return sha1. 25 */ 26staticinlineconst struct object_id *lookup_replace_object(struct repository *r, 27const struct object_id *oid) 28{ 29if(!check_replace_refs || 30(r->objects->replace_map && 31 r->objects->replace_map->map.tablesize ==0)) 32return oid; 33returndo_lookup_replace_object(r, oid); 34} 35 36#endif/* REPLACE_OBJECT_H */