Skip to content

Commit 87f1b2d

Browse files
sunshinecogitster
authored andcommitted
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>
1 parent 5cf00cb commit 87f1b2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

range-diff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static void output_pair_header(struct diff_options *diffopt,
323323
}
324324
strbuf_addf(buf, "%s\n", color_reset);
325325

326-
fwrite(buf->buf, buf->len, 1, stdout);
326+
fwrite(buf->buf, buf->len, 1, diffopt->file);
327327
}
328328

329329
static struct userdiff_driver no_func_name = {

0 commit comments

Comments
 (0)