MCPcopy Create free account
hub / github.com/git/git / maybe_debug_wrap_ref_store

Function maybe_debug_wrap_ref_store

refs/debug.c:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13extern struct ref_storage_be refs_be_debug;
14
15struct ref_store *maybe_debug_wrap_ref_store(const char *gitdir, struct ref_store *store)
16{
17 struct debug_ref_store *res;
18 struct ref_storage_be *be_copy;
19
20 if (!trace_want(&trace_refs)) {
21 return store;
22 }
23 res = xmalloc(sizeof(struct debug_ref_store));
24 be_copy = xmalloc(sizeof(*be_copy));
25 *be_copy = refs_be_debug;
26 /* we never deallocate backends, so safe to copy the pointer. */
27 be_copy->name = store->be->name;
28 trace_printf_key(&trace_refs, "ref_store for %s\n", gitdir);
29 res->refs = store;
30 base_ref_store_init((struct ref_store *)res, store->repo, gitdir,
31 be_copy);
32 return (struct ref_store *)res;
33}
34
35static void debug_release(struct ref_store *refs)
36{

Callers 1

get_main_ref_storeFunction · 0.85

Calls 3

trace_wantFunction · 0.85
base_ref_store_initFunction · 0.85
xmallocFunction · 0.50

Tested by

no test coverage detected