MCPcopy Index your code
hub / github.com/git/git / prepare_replace_object

Function prepare_replace_object

replace-object.c:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void prepare_replace_object(struct repository *r)
37{
38 if (r->objects->replace_map_initialized)
39 return;
40
41 pthread_mutex_lock(&r->objects->replace_mutex);
42 if (r->objects->replace_map_initialized) {
43 pthread_mutex_unlock(&r->objects->replace_mutex);
44 return;
45 }
46
47 oidmap_init(&r->objects->replace_map, 0);
48
49 refs_for_each_replace_ref(get_main_ref_store(r),
50 register_replace_ref, r);
51 r->objects->replace_map_initialized = 1;
52
53 pthread_mutex_unlock(&r->objects->replace_mutex);
54}
55
56/* We allow "recursive" replacement. Only within reason, though */
57#define MAXREPLACEDEPTH 5

Callers 2

commit_graph_compatibleFunction · 0.85
do_lookup_replace_objectFunction · 0.85

Calls 3

oidmap_initFunction · 0.85
get_main_ref_storeFunction · 0.85

Tested by

no test coverage detected