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 <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine committed
Jul 22, 2018 at 05:57 UTC
87f1b2d45ca7987cc6cc1a74eb66a77fa11fab94
1 file changed
+1
-1
range-diff.c
+1
-1
@@ -323,7 +323,7 @@ static void output_pair_header(struct diff_options *diffopt,
323
}
324
strbuf_addf(buf, "%s\n", color_reset);
325
326
- fwrite(buf->buf, buf->len, 1, stdout);
326
+ fwrite(buf->buf, buf->len, 1, diffopt->file);
327
}
328
329
static struct userdiff_driver no_func_name = {