Disable color detection during format-patch
[gitweb.git] / builtin-diff.c
index 91235a118a3878c0d0445a741ce3182c11cdf705..d520c7ca294fcd8e619135bfe8932650d850724c 100644 (file)
@@ -252,9 +252,13 @@ int cmd_diff(int argc, const char **argv, char **envp)
 
        git_config(git_diff_config);
        init_revisions(&rev);
-       rev.diffopt.output_format = DIFF_FORMAT_PATCH;
 
        argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!rev.diffopt.output_format) {
+               rev.diffopt.output_format = DIFF_FORMAT_PATCH;
+               diff_setup_done(&rev.diffopt);
+       }
+
        /* Do we have --cached and not have a pending object, then
         * default to HEAD by hand.  Eek.
         */