Code

add -e: do not show difference in a submodule that is merely dirty
[git.git] / builtin / config.c
index 3e3c52849773348a568241f678b3e3ee2e8d123a..211e118d575411b712ccf0387db2408708576902 100644 (file)
@@ -436,9 +436,14 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                              NULL, NULL);
        }
        else if (actions == ACTION_SET) {
+               int ret;
                check_argc(argc, 2, 2);
                value = normalize_value(argv[0], argv[1]);
-               return git_config_set(argv[0], value);
+               ret = git_config_set(argv[0], value);
+               if (ret == CONFIG_NOTHING_SET)
+                       error("cannot overwrite multiple values with a single value\n"
+                       "       Use a regexp, --add or --set-all to change %s.", argv[0]);
+               return ret;
        }
        else if (actions == ACTION_SET_ALL) {
                check_argc(argc, 2, 3);