| 29 | static const char *next_server_feature_value(const char *feature, size_t *len, size_t *offset); |
| 30 | |
| 31 | static 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 | |
| 56 | int check_ref_type(const struct ref *ref, int flags) |
| 57 | { |
no test coverage detected