submodule-config: correct error reporting for invalid ignore value
authorStefan Beller <sbeller@google.com>
Tue, 14 Mar 2017 22:14:40 +0000 (15:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Mar 2017 18:26:08 +0000 (11:26 -0700)
As 'var' contains the whole value we get error messages that repeat
the section and key currently:

warning: Invalid parameter 'true' for config option 'submodule.submodule.plugins/hooks.ignore.ignore'

Fix this by only giving the section name in the warning.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule-config.c
index 098085be69b97687b0febfe9e29c6dc0c64569a1..38c25c99386fcd22a3bfaa73267521792977bc71 100644 (file)
@@ -331,7 +331,7 @@ static int parse_config(const char *var, const char *value, void *data)
                         strcmp(value, "all") &&
                         strcmp(value, "none"))
                        warning("Invalid parameter '%s' for config option "
-                                       "'submodule.%s.ignore'", value, var);
+                                       "'submodule.%s.ignore'", value, name.buf);
                else {
                        free((void *) submodule->ignore);
                        submodule->ignore = xstrdup(value);