* Check if one of the prefixes is a prefix of the ref. * If no prefixes were provided, all refs match. */
| 52 | * If no prefixes were provided, all refs match. |
| 53 | */ |
| 54 | static int ref_match(const struct strvec *prefixes, const char *refname) |
| 55 | { |
| 56 | if (!prefixes->nr) |
| 57 | return 1; /* no restriction */ |
| 58 | |
| 59 | for (size_t i = 0; i < prefixes->nr; i++) { |
| 60 | const char *prefix = prefixes->v[i]; |
| 61 | |
| 62 | if (starts_with(refname, prefix)) |
| 63 | return 1; |
| 64 | } |
| 65 | |
| 66 | return 0; |
| 67 | } |
| 68 | |
| 69 | struct ls_refs_data { |
| 70 | unsigned peel; |
no test coverage detected