Code

Merge branch 'jc/diff-test-updates' into th/diff
[git.git] / builtin-diff.c
index 91235a118a3878c0d0445a741ce3182c11cdf705..47e0a37e212d9a7085714d1b5d6d8f2ffda8d5a6 100644 (file)
@@ -252,9 +252,11 @@ 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;
+
        /* Do we have --cached and not have a pending object, then
         * default to HEAD by hand.  Eek.
         */