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

Function check_ref

connect.c:31–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset);
30
31static int check_ref(const char *name, unsigned int flags)
32{
33 if (!flags)
34 return 1;
35
36 if (!skip_prefix(name, "refs/", &name))
37 return 0;
38
39 /* REF_NORMAL means that we don't want the magic fake tag refs */
40 if ((flags & REF_NORMAL) && check_refname_format(name,
41 REFNAME_ALLOW_ONELEVEL))
42 return 0;
43
44 /* REF_BRANCHES means that we want regular branch heads */
45 if ((flags & REF_BRANCHES) && starts_with(name, "heads/"))
46 return 1;
47
48 /* REF_TAGS means that we want tags */
49 if ((flags & REF_TAGS) && starts_with(name, "tags/"))
50 return 1;
51
52 /* All type bits clear means that we are ok with anything */
53 return !(flags & ~REF_NORMAL);
54}
55
56int check_ref_type(const struct ref *ref, int flags)
57{

Callers 2

check_ref_typeFunction · 0.70
process_refFunction · 0.70

Calls 2

check_refname_formatFunction · 0.85
starts_withFunction · 0.85

Tested by

no test coverage detected