@matheusbsbs / matheus-bagliano / commits / 5e363541d0
Fork 0

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>

Junio C Hamano committed May 22, 2006 at 00:31 UTC 5e363541d0431b640e4bbbafb2941d1c64fa13c4
1 file changed +8
diff.c
+8
@@ -1303,6 +1303,14 @@ int diff_setup_done(struct diff_options *options)
1303 (options->output_format == DIFF_FORMAT_CHECKDIFF))
1304 options->recursive = 1;
1305
1306 + /*
1307 + * These combinations do not make sense.
1308 + */
1309 + if (options->output_format == DIFF_FORMAT_RAW)
1310 + options->with_raw = 0;
1311 + if (options->output_format == DIFF_FORMAT_DIFFSTAT)
1312 + options->with_stat = 0;
1313 +
1314 if (options->detect_rename && options->rename_limit < 0)
1315 options->rename_limit = diff_rename_limit_default;
1316 if (options->setup & DIFF_SETUP_USE_CACHE) {