summaryrefslogtreecommitdiff
path: root/range-diff.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2018-11-09 10:18:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-12 03:09:21 (GMT)
commit4624185a67aa17104762a4bbff2b05727ef4cd83 (patch)
tree54f669ec755a6e3ea7007b80fc7ac7d0f36c24c9 /range-diff.c
parentdf569c3f31f4aab5f9fd003029090a321bacd2bd (diff)
downloadgit-4624185a67aa17104762a4bbff2b05727ef4cd83.zip
git-4624185a67aa17104762a4bbff2b05727ef4cd83.tar.gz
git-4624185a67aa17104762a4bbff2b05727ef4cd83.tar.bz2
range-diff: fix regression in passing along diff options
In 73a834e9e2 ("range-diff: relieve callers of low-level configuration burden", 2018-07-22) we broke passing down options like --no-patch, --stat etc. Fix that regression, and add a test asserting the pre-73a834e9e2 behavior for some of these diff options. As noted in a change leading up to this ("range-diff doc: add a section about output stability", 2018-11-07) the output is not meant to be stable. So this regression test will likely need to be tweaked once we get a "proper" --stat option. See https://public-inbox.org/git/nycvar.QRO.7.76.6.1811071202480.39@tvgsbejvaqbjf.bet/ for a further explanation of the regression. The fix here is not the same as in Johannes's on-list patch, for reasons that'll be explained in a follow-up commit. The quoting of "EOF" here mirrors that of an earlier test. Perhaps that should be fixed, but let's leave that up to a later cleanup change. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'range-diff.c')
-rw-r--r--range-diff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/range-diff.c b/range-diff.c
index 3dd2edd..1e72928 100644
--- a/range-diff.c
+++ b/range-diff.c
@@ -433,7 +433,7 @@ int show_range_diff(const char *range1, const char *range2,
struct strbuf indent = STRBUF_INIT;
memcpy(&opts, diffopt, sizeof(opts));
- opts.output_format = DIFF_FORMAT_PATCH;
+ opts.output_format |= DIFF_FORMAT_PATCH;
opts.flags.suppress_diff_headers = 1;
opts.flags.dual_color_diffed_diffs = dual_color;
opts.output_prefix = output_prefix_cb;