MCPcopy Index your code
hub / github.com/git/git / ref_is_hidden

Function ref_is_hidden

refs.c:1710–1740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1708}
1709
1710int 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
1742const char **hidden_refs_to_excludes(const struct strvec *hide_refs)
1743{

Callers 6

mark_our_refFunction · 0.85
parse_want_refFunction · 0.85
ref_excludedFunction · 0.85
send_refFunction · 0.85
show_ref_cbFunction · 0.85
reject_updates_to_hiddenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected