Set default diff output format after parsing command line

Initialize output_format to 0 instead of DIFF_FORMAT_RAW so that we can see
later if any command line options changed it.  Default value is set only if
output format was not specified.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Timo Hirvonen
2006-06-24 20:24:14 +03:00
committed by Junio C Hamano
parent a610786f4b
commit c9b5ef998a
7 changed files with 18 additions and 3 deletions

View File

@ -28,6 +28,9 @@ int cmd_diff_index(int argc, const char **argv, char **envp)
else
usage(diff_cache_usage);
}
if (!rev.diffopt.output_format)
rev.diffopt.output_format = DIFF_FORMAT_RAW;
/*
* Make sure there is one revision (i.e. pending object),
* and there is no revision filtering parameters.