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:
committed by
Junio C Hamano
parent
a610786f4b
commit
c9b5ef998a
@ -252,9 +252,11 @@ int cmd_diff(int argc, const char **argv, char **envp)
|
||||
|
||||
git_config(git_diff_config);
|
||||
init_revisions(&rev);
|
||||
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
|
||||
|
||||
argc = setup_revisions(argc, argv, &rev, NULL);
|
||||
if (!rev.diffopt.output_format)
|
||||
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
|
||||
|
||||
/* Do we have --cached and not have a pending object, then
|
||||
* default to HEAD by hand. Eek.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user