MCPcopy Create free account
hub / github.com/git/git / hidden_refs_to_excludes

Function hidden_refs_to_excludes

refs.c:1742–1764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1740}
1741
1742const 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
1766const char **get_namespaced_exclude_patterns(const char **exclude_patterns,
1767 const char *namespace,

Callers 3

ls_refsFunction · 0.85
write_head_infoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected