| 1740 | } |
| 1741 | |
| 1742 | const char **hidden_refs_to_excludes(const struct strvec *hide_refs) |
| 1743 | { |
| 1744 | const char **pattern; |
| 1745 | for (pattern = hide_refs->v; *pattern; pattern++) { |
| 1746 | /* |
| 1747 | * We can't feed any excludes from hidden refs config |
| 1748 | * sections, since later rules may override previous |
| 1749 | * ones. For example, with rules "refs/foo" and |
| 1750 | * "!refs/foo/bar", we should show "refs/foo/bar" (and |
| 1751 | * everything underneath it), but the earlier exclusion |
| 1752 | * would cause us to skip all of "refs/foo". We |
| 1753 | * likewise don't implement the namespace stripping |
| 1754 | * required for '^' rules. |
| 1755 | * |
| 1756 | * Both are possible to do, but complicated, so avoid |
| 1757 | * populating the jump list at all if we see either of |
| 1758 | * these patterns. |
| 1759 | */ |
| 1760 | if (**pattern == '!' || **pattern == '^') |
| 1761 | return NULL; |
| 1762 | } |
| 1763 | return hide_refs->v; |
| 1764 | } |
| 1765 | |
| 1766 | const char **get_namespaced_exclude_patterns(const char **exclude_patterns, |
| 1767 | const char *namespace, |
no outgoing calls
no test coverage detected