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

Function parse_hide_refs_config

refs.c:1688–1708  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1686}
1687
1688int parse_hide_refs_config(const char *var, const char *value, const char *section,
1689 struct strvec *hide_refs)
1690{
1691 const char *key;
1692 if (!strcmp("transfer.hiderefs", var) ||
1693 (!parse_config_key(var, section, NULL, NULL, &key) &&
1694 !strcmp(key, "hiderefs"))) {
1695 char *ref;
1696 int len;
1697
1698 if (!value)
1699 return config_error_nonbool(var);
1700
1701 /* drop const to remove trailing '/' characters */
1702 ref = (char *)strvec_push(hide_refs, value);
1703 len = strlen(ref);
1704 while (len && ref[len - 1] == '/')
1705 ref[--len] = '\0';
1706 }
1707 return 0;
1708}
1709
1710int ref_is_hidden(const char *refname, const char *refname_full,
1711 const struct strvec *hide_refs)

Callers 4

upload_pack_configFunction · 0.85
hide_refs_configFunction · 0.85
ls_refs_configFunction · 0.85
receive_pack_configFunction · 0.85

Calls 3

parse_config_keyFunction · 0.85
config_error_nonboolFunction · 0.85
strvec_pushFunction · 0.85

Tested by

no test coverage detected