Merge branch 'sb/parse-hide-refs-config-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Mar 2017 21:24:21 +0000 (13:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Mar 2017 21:24:21 +0000 (13:24 -0800)
Code clean-up.

* sb/parse-hide-refs-config-cleanup:
refs: parse_hide_refs_config to use parse_config_key

refs.c
diff --git a/refs.c b/refs.c
index 6d0961921b25d2296195bddb3666b6537b0e0fb2..eec36a2a94910ecb1e798f4243289aec4eee93b7 100644 (file)
--- 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;