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

Function alloc_ref_with_prefix

remote.c:976–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976static struct ref *alloc_ref_with_prefix(const char *prefix, size_t prefixlen,
977 const char *name)
978{
979 size_t len = strlen(name);
980 struct ref *ref = xcalloc(1, st_add4(sizeof(*ref), prefixlen, len, 1));
981 memcpy(ref->name, prefix, prefixlen);
982 memcpy(ref->name + prefixlen, name, len);
983 return ref;
984}
985
986struct ref *alloc_ref(const char *name)
987{

Callers 2

alloc_refFunction · 0.85
get_local_refFunction · 0.85

Calls 1

xcallocFunction · 0.85

Tested by

no test coverage detected