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

Function get_local_ref

remote.c:2059–2073  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2057}
2058
2059static struct ref *get_local_ref(const char *name)
2060{
2061 if (!name || name[0] == '\0')
2062 return NULL;
2063
2064 if (starts_with(name, "refs/"))
2065 return alloc_ref(name);
2066
2067 if (starts_with(name, "heads/") ||
2068 starts_with(name, "tags/") ||
2069 starts_with(name, "remotes/"))
2070 return alloc_ref_with_prefix("refs/", 5, name);
2071
2072 return alloc_ref_with_prefix("refs/heads/", 11, name);
2073}
2074
2075int get_fetch_map(const struct ref *remote_refs,
2076 const struct refspec_item *refspec,

Callers 2

get_fetch_mapFunction · 0.85

Calls 3

starts_withFunction · 0.85
alloc_refFunction · 0.85
alloc_ref_with_prefixFunction · 0.85

Tested by

no test coverage detected