summaryrefslogtreecommitdiffstats
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-10 22:24:21 +0100
committerJunio C Hamano <gitster@pobox.com>2017-03-10 22:24:21 +0100
commit34061299002fcbf5467385debbd9ad3d5f1c5a4e (patch)
treed7e7db49b43c439ba138c5afa1598500e2266037 /refs.c
parentMerge branch 'jt/upload-pack-error-report' (diff)
parentrefs: parse_hide_refs_config to use parse_config_key (diff)
downloadgit-34061299002fcbf5467385debbd9ad3d5f1c5a4e.tar.xz
git-34061299002fcbf5467385debbd9ad3d5f1c5a4e.zip
Merge branch 'sb/parse-hide-refs-config-cleanup'
Code clean-up. * sb/parse-hide-refs-config-cleanup: refs: parse_hide_refs_config to use parse_config_key
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 6d0961921b..eec36a2a94 100644
--- a/refs.c
+++ b/refs.c
@@ -1035,10 +1035,11 @@ static struct string_list *hide_refs;
int parse_hide_refs_config(const char *var, const char *value, const char *section)
{
+ const char *subsection, *key;
+ int subsection_len;
if (!strcmp("transfer.hiderefs", var) ||
- /* NEEDSWORK: use parse_config_key() once both are merged */
- (starts_with(var, section) && var[strlen(section)] == '.' &&
- !strcmp(var + strlen(section), ".hiderefs"))) {
+ (!parse_config_key(var, section, &subsection, &subsection_len, &key)
+ && !subsection && !strcmp(key, "hiderefs"))) {
char *ref;
int len;