diff: do not use configuration magic at the core-level
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 4bea3066a8a01378a0574b5d6280a78ed88317d5..493650cc0eccfcb91422f3e4ff7de766590ba22c 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -102,7 +102,13 @@ static const char *parse_diff_color_value(const char *value, const char *var)
        die("bad config value '%s' for variable '%s'", value, var);
 }
 
-int git_diff_config(const char *var, const char *value)
+/*
+ * These are to give UI layer defaults.
+ * The core-level commands such as git-diff-files should
+ * never be affected by the setting of diff.renames
+ * the user happens to have in the configuration file.
+ */
+int git_diff_ui_config(const char *var, const char *value)
 {
        if (!strcmp(var, "diff.renamelimit")) {
                diff_rename_limit_default = git_config_int(var, value);
@@ -1625,6 +1631,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
        }
        else if (!strcmp(arg, "--color"))
                options->color_diff = 1;
+       else if (!strcmp(arg, "--no-color"))
+               options->color_diff = 0;
        else if (!strcmp(arg, "-w") || !strcmp(arg, "--ignore-all-space"))
                options->xdl_opts |= XDF_IGNORE_WHITESPACE;
        else if (!strcmp(arg, "-b") || !strcmp(arg, "--ignore-space-change"))