aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-22 00:31:02 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-22 00:31:02 -0700
commit5e363541d0431b640e4bbbafb2941d1c64fa13c4 (patch)
treebca491b70d71bd41b2c2f3990e62087df00c3521 /diff.c
parentd5e3d60c200b214e36eacfb3de21044a7efd1971 (diff)
downloadgit-5e363541d0431b640e4bbbafb2941d1c64fa13c4.tar.gz
git-5e363541d0431b640e4bbbafb2941d1c64fa13c4.tar.xz
diff: minor option combination fix.
output_format == DIFFSTAT and with_stat == true does not make sense, and the way the code is structured it causes trouble. Avoid it. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index d3bb10e00..160178367 100644
--- a/diff.c
+++ b/diff.c
@@ -1303,6 +1303,14 @@ int diff_setup_done(struct diff_options *options)
(options->output_format == DIFF_FORMAT_CHECKDIFF))
options->recursive = 1;
+ /*
+ * These combinations do not make sense.
+ */
+ if (options->output_format == DIFF_FORMAT_RAW)
+ options->with_raw = 0;
+ if (options->output_format == DIFF_FORMAT_DIFFSTAT)
+ options->with_stat = 0;
+
if (options->detect_rename && options->rename_limit < 0)
options->rename_limit = diff_rename_limit_default;
if (options->setup & DIFF_SETUP_USE_CACHE) {