summaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-30 04:27:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-30 04:47:55 (GMT)
commitd8981c3f885ceaddfec0e545b0f995b96e5ec58f (patch)
tree7337c0018c55bb91e000b78c8c2b8e973e71e070 /range-diff.c
parent7068cbc4abac53d9c3675dfba81c1e97d25e8eeb (diff)
downloadgit-d8981c3f885ceaddfec0e545b0f995b96e5ec58f.zip
git-d8981c3f885ceaddfec0e545b0f995b96e5ec58f.tar.gz
git-d8981c3f885ceaddfec0e545b0f995b96e5ec58f.tar.bz2
format-patch: do not let its diff-options affect --range-diff
Stop leaking how the primary output of format-patch is customized to the range-diff machinery and instead let the latter use its own "reasonable default", in order to correct the breakage introduced by a5170794 ("Merge branch 'ab/range-diff-no-patch'", 2018-11-18) on the 'master' front. "git format-patch --range-diff..." without any weird diff option started to include the "range-diff --stat" output, which is rather useless right now, that made the whole thing unusable and this is probably the least disruptive way to whip the codebase into a shippable shape. We may want to later make the range-diff driven by format-patch more configurable, but that would have to wait until we have a good design. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/range-diff.c b/range-diff.c
index 767af8c..48b0e1b 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;