Merge branch 'maint-1.6.0' into maint
[gitweb.git] / wt-status.c
index ec91fba601bab8a6e9545952cf08a0a544c8107d..96ff2f8f564b907b9ef77bd2ea41b5e854a13085 100644 (file)
@@ -279,12 +279,21 @@ static void wt_status_print_verbose(struct wt_status *s)
        struct rev_info rev;
 
        init_revisions(&rev, NULL);
+       DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
        setup_revisions(0, NULL, &rev,
                s->is_initial ? EMPTY_TREE_SHA1_HEX : s->reference);
        rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
        rev.diffopt.detect_rename = 1;
        rev.diffopt.file = s->fp;
        rev.diffopt.close_file = 0;
+       /*
+        * If we're not going to stdout, then we definitely don't
+        * want color, since we are going to the commit message
+        * file (and even the "auto" setting won't work, since it
+        * will have checked isatty on stdout).
+        */
+       if (s->fp != stdout)
+               DIFF_OPT_CLR(&rev.diffopt, COLOR_DIFF);
        run_diff_index(&rev, 1);
 }
 
@@ -401,5 +410,5 @@ int git_status_config(const char *k, const char *v, void *cb)
                        return error("Invalid untracked files mode '%s'", v);
                return 0;
        }
-       return git_color_default_config(k, v, cb);
+       return git_diff_ui_config(k, v, cb);
 }