| 1708 | } |
| 1709 | |
| 1710 | int ref_is_hidden(const char *refname, const char *refname_full, |
| 1711 | const struct strvec *hide_refs) |
| 1712 | { |
| 1713 | int i; |
| 1714 | |
| 1715 | for (i = hide_refs->nr - 1; i >= 0; i--) { |
| 1716 | const char *match = hide_refs->v[i]; |
| 1717 | const char *subject; |
| 1718 | int neg = 0; |
| 1719 | const char *p; |
| 1720 | |
| 1721 | if (*match == '!') { |
| 1722 | neg = 1; |
| 1723 | match++; |
| 1724 | } |
| 1725 | |
| 1726 | if (*match == '^') { |
| 1727 | subject = refname_full; |
| 1728 | match++; |
| 1729 | } else { |
| 1730 | subject = refname; |
| 1731 | } |
| 1732 | |
| 1733 | /* refname can be NULL when namespaces are used. */ |
| 1734 | if (subject && |
| 1735 | skip_prefix(subject, match, &p) && |
| 1736 | (!*p || *p == '/')) |
| 1737 | return !neg; |
| 1738 | } |
| 1739 | return 0; |
| 1740 | } |
| 1741 | |
| 1742 | const char **hidden_refs_to_excludes(const struct strvec *hide_refs) |
| 1743 | { |
no outgoing calls
no test coverage detected