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

Function copy_ref

remote.c:991–1005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991struct ref *copy_ref(const struct ref *ref)
992{
993 struct ref *cpy;
994 size_t len;
995 if (!ref)
996 return NULL;
997 len = st_add3(sizeof(struct ref), strlen(ref->name), 1);
998 cpy = xmalloc(len);
999 memcpy(cpy, ref, len);
1000 cpy->next = NULL;
1001 cpy->symref = xstrdup_or_null(ref->symref);
1002 cpy->remote_status = xstrdup_or_null(ref->remote_status);
1003 cpy->peer_ref = copy_ref(ref->peer_ref);
1004 return cpy;
1005}
1006
1007struct ref *copy_ref_list(const struct ref *ref)
1008{

Callers 9

filter_refsFunction · 0.85
copy_ref_listFunction · 0.85
match_explicitFunction · 0.85
add_missing_tagsFunction · 0.85
match_push_refsFunction · 0.85
get_expanded_mapFunction · 0.85
get_remote_refFunction · 0.85
guess_remote_headFunction · 0.85
wanted_peer_refsFunction · 0.85

Calls 2

xstrdup_or_nullFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected