From: Eric Sunshine Date: Sun, 22 Jul 2018 09:57:10 +0000 (-0400) Subject: range-diff: respect diff_option.file rather than assuming 'stdout' X-Git-Tag: v2.20.0-rc0~239^2~7 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/87f1b2d45ca7987cc6cc1a74eb66a77fa11fab94 range-diff: respect diff_option.file rather than assuming 'stdout' The actual diffs output by range-diff respect diff_option.file, which range-diff passes down the call-chain, thus are destination-agnostic. However, output_pair_header() is hard-coded to emit to 'stdout'. Fix this by making output_pair_header() respect diff_option.file, as well. Signed-off-by: Eric Sunshine Signed-off-by: Junio C Hamano --- diff --git a/range-diff.c b/range-diff.c index b6b9abac26..defe31f095 100644 --- a/range-diff.c +++ b/range-diff.c @@ -323,7 +323,7 @@ static void output_pair_header(struct diff_options *diffopt, } strbuf_addf(buf, "%s\n", color_reset); - fwrite(buf->buf, buf->len, 1, stdout); + fwrite(buf->buf, buf->len, 1, diffopt->file); } static struct userdiff_driver no_func_name = {