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>
This commit is contained in:
Junio C Hamano 2006-05-22 00:31:02 -07:00
Родитель d5e3d60c20
Коммит 5e363541d0
1 изменённых файлов: 8 добавлений и 0 удалений

8
diff.c
Просмотреть файл

@ -1303,6 +1303,14 @@ int diff_setup_done(struct diff_options *options)
(options->output_format == DIFF_FORMAT_CHECKDIFF)) (options->output_format == DIFF_FORMAT_CHECKDIFF))
options->recursive = 1; 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) if (options->detect_rename && options->rename_limit < 0)
options->rename_limit = diff_rename_limit_default; options->rename_limit = diff_rename_limit_default;
if (options->setup & DIFF_SETUP_USE_CACHE) { if (options->setup & DIFF_SETUP_USE_CACHE) {