| 1686 | } |
| 1687 | |
| 1688 | int 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 | |
| 1710 | int ref_is_hidden(const char *refname, const char *refname_full, |
| 1711 | const struct strvec *hide_refs) |
no test coverage detected