Skip to content

Commit

Permalink
diff: minor option combination fix.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 22, 2006
1 parent d5e3d60 commit 5e36354
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5e36354

Please sign in to comment.