upload-pack: use object pointer not copy of sha1 to keep track of has/needs.
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 1f0219dbe40e6c750766d8c7694af47fbdc854d2..3e26180f08204df2e7519e4613aa6e3e844e21b2 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -110,8 +110,14 @@ int git_diff_config(const char *var, const char *value)
        if (!strcmp(var, "diff.color")) {
                if (!value)
                        diff_use_color_default = 1; /* bool */
-               else if (!strcasecmp(value, "auto"))
-                       diff_use_color_default = isatty(1);
+               else if (!strcasecmp(value, "auto")) {
+                       diff_use_color_default = 0;
+                       if (isatty(1)) {
+                               char *term = getenv("TERM");
+                               if (term && strcmp(term, "dumb"))
+                                       diff_use_color_default = 1;
+                       }
+               }
                else if (!strcasecmp(value, "never"))
                        diff_use_color_default = 0;
                else if (!strcasecmp(value, "always"))
@@ -1561,7 +1567,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
                options->output_format |= DIFF_FORMAT_PATCH;
                options->full_index = options->binary = 1;
        }
-       else if (!strcmp(arg, "--text")) {
+       else if (!strcmp(arg, "-a") || !strcmp(arg, "--text")) {
                options->text = 1;
        }
        else if (!strcmp(arg, "--name-only"))