summaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2016-06-22 17:02:04 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-06-24 15:20:47 -0700
commit36a4d905c36a598d17274765b57690ecfb4a23f8 (patch)
tree54996ef84cc7a5471fd8e38ef5e2657dbe1ff027 /builtin/log.c
parentformat-patch: avoid freopen() (diff)
downloadtgif-36a4d905c36a598d17274765b57690ecfb4a23f8.tar.xz
format-patch: use stdout directly
Earlier, we freopen()ed stdout in order to write patches to files. That forced us to duplicate stdout (naming it "realstdout") because we *still* wanted to be able to report the file names. As we do not abuse stdout that way anymore, we no longer need to duplicate stdout, either. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/builtin/log.c b/builtin/log.c
index caa9fe84a3..1a6903b3f0 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -805,7 +805,6 @@ static int git_format_config(const char *var, const char *value, void *cb)
return git_log_config(var, value, cb);
}
-static FILE *realstdout = NULL;
static const char *output_directory = NULL;
static int outdir_offset;
@@ -831,7 +830,7 @@ static int open_next_file(struct commit *commit, const char *subject,
fmt_output_subject(&filename, subject, rev);
if (!quiet)
- fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
+ printf("%s\n", filename.buf + outdir_offset);
if ((rev->diffopt.file = fopen(filename.buf, "w")) == NULL)
return error(_("Cannot open patch file %s"), filename.buf);
@@ -1639,9 +1638,6 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
get_patch_ids(&rev, &ids);
}
- if (!use_stdout)
- realstdout = xfdopen(xdup(1), "w");
-
if (prepare_revision_walk(&rev))
die(_("revision walk setup failed"));
rev.boundary = 1;