summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:15 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:15 -0700
commit63641fb07131bede8273c3b3057792c9dcf7356b (patch)
tree9306790da18384a4ef34a1d4218b081e19b965ec /diff.c
parent7725bebe21dfa4877dad74b1ac3d921f26f949cf (diff)
parentbac233f2c28428c3e2c5279910bc4c027cd0b540 (diff)
downloadgit-63641fb07131bede8273c3b3057792c9dcf7356b.tar.gz
Merge branch 'js/log-to-diffopt-file'
The commands in the "log/diff" family have had an FILE* pointer in the data structure they pass around for a long time, but some codepaths used to always write to the standard output. As a preparatory step to make "git format-patch" available to the internal callers, these codepaths have been updated to consistently write into that FILE* instead. * js/log-to-diffopt-file: mingw: fix the shortlog --output=<file> test diff: do not color output when --color=auto and --output=<file> is given t4211: ensure that log respects --output=<file> shortlog: respect the --output=<file> setting format-patch: use stdout directly format-patch: avoid freopen() format-patch: explicitly switch off color when writing to files shortlog: support outputting to streams other than stdout graph: respect the diffopt.file setting line-log: respect diffopt's configured output file stream log-tree: respect diffopt's configured output file stream log: prepare log/log-tree to reuse the diffopt.close_file attribute
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index fa78fc189c..b66b9beabc 100644
--- a/diff.c
+++ b/diff.c
@@ -3977,6 +3977,8 @@ int diff_opt_parse(struct diff_options *options,
if (!options->file)
die_errno("Could not open '%s'", path);
options->close_file = 1;
+ if (options->use_color != GIT_COLOR_ALWAYS)
+ options->use_color = GIT_COLOR_NEVER;
return argcount;
} else
return 0;