diff options
| author | Junio C Hamano <gitster@pobox.com> | 2018-12-01 21:41:42 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2018-12-01 21:41:42 +0900 |
| commit | d32fa3c6f7f441c7c9f16d0661ce041e6f9a3439 (patch) | |
| tree | 7337c0018c55bb91e000b78c8c2b8e973e71e070 /range-diff.c | |
| parent | 7068cbc4abac53d9c3675dfba81c1e97d25e8eeb (diff) | |
| parent | d8981c3f885ceaddfec0e545b0f995b96e5ec58f (diff) | |
Merge branch 'jc/format-patch-range-diff-fix'
"git format-patch --range-diff" by mistake passed the diff options
used to generate the primary output of the command to the
range-diff machinery, which caused the range-diff in the cover
letter to include fairly useless "--stat" output. This has been
corrected by forcing a non-customizable default formatting options
on the range-diff machinery when driven by format-patch.
* jc/format-patch-range-diff-fix:
format-patch: do not let its diff-options affect --range-diff
Diffstat (limited to 'range-diff.c')
| -rw-r--r-- | range-diff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/range-diff.c b/range-diff.c index 767af8c5bb..48b0e1b4ce 100644 --- a/range-diff.c +++ b/range-diff.c @@ -460,7 +460,11 @@ int show_range_diff(const char *range1, const char *range2, struct diff_options opts; struct strbuf indent = STRBUF_INIT; - memcpy(&opts, diffopt, sizeof(opts)); + if (diffopt) + memcpy(&opts, diffopt, sizeof(opts)); + else + diff_setup(&opts); + if (!opts.output_format) opts.output_format = DIFF_FORMAT_PATCH; opts.flags.suppress_diff_headers = 1; |
