summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-06-20 13:03:26 -0700
committerJunio C Hamano <gitster@pobox.com>2016-06-20 13:03:26 -0700
commit3f39bf376985a9e87d7c28a986e17dff4727e74c (patch)
tree022830e1b2afc9596c6453c8d090198f86850653
parentef74594e42e57308ef67b4bef03e42c137e7ad4b (diff)
downloadgit-js/log-diff-to-non-stdout.tar.gz
-rw-r--r--builtin/log.c4
-rw-r--r--builtin/shortlog.c2
-rw-r--r--graph.c8
-rw-r--r--line-log.c4
-rw-r--r--log-tree.c17
5 files changed, 17 insertions, 18 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 5a889d5442..2bfcc43ea3 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -889,8 +889,8 @@ static void print_signature(FILE *file)
fprintf(file, "-- \n%s", signature);
if (signature[strlen(signature)-1] != '\n')
- fputc('\n', file);
- fputc('\n', file);
+ putc('\n', file);
+ putc('\n', file);
}
static void add_branch_description(struct strbuf *buf, const char *branch_name)
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 4c68ba7f3c..39d74fe23b 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -328,7 +328,7 @@ void shortlog_output(struct shortlog *log)
else
fprintf(log->file, " %s\n", msg);
}
- fputc('\n', log->file);
+ putc('\n', log->file);
onelines->strdup_strings = 1;
string_list_clear(onelines, 0);
free(onelines);
diff --git a/graph.c b/graph.c
index 8ae56bc37e..8ad8ba362f 100644
--- a/graph.c
+++ b/graph.c
@@ -1196,7 +1196,7 @@ void graph_show_commit(struct git_graph *graph)
fwrite(msgbuf.buf, sizeof(char), msgbuf.len,
graph->revs->diffopt.file);
if (!shown_commit_line)
- fputc('\n', graph->revs->diffopt.file);
+ putc('\n', graph->revs->diffopt.file);
strbuf_setlen(&msgbuf, 0);
}
@@ -1246,7 +1246,7 @@ int graph_show_remainder(struct git_graph *graph)
shown = 1;
if (!graph_is_commit_finished(graph))
- fputc('\n', graph->revs->diffopt.file);
+ putc('\n', graph->revs->diffopt.file);
else
break;
}
@@ -1322,7 +1322,7 @@ void graph_show_commit_msg(struct git_graph *graph,
* new line.
*/
if (!newline_terminated)
- fputc('\n', graph->revs->diffopt.file);
+ putc('\n', graph->revs->diffopt.file);
graph_show_remainder(graph);
@@ -1330,6 +1330,6 @@ void graph_show_commit_msg(struct git_graph *graph,
* If sb ends with a newline, our output should too.
*/
if (newline_terminated)
- fputc('\n', graph->revs->diffopt.file);
+ putc('\n', graph->revs->diffopt.file);
}
}
diff --git a/line-log.c b/line-log.c
index c3b8563190..e62a7f4ac4 100644
--- a/line-log.c
+++ b/line-log.c
@@ -854,10 +854,10 @@ static void print_line(const char *prefix, char first,
fputs(prefix, file);
fputs(color, file);
- fputc(first, file);
+ putc(first, file);
fwrite(begin, 1, end-begin, file);
fputs(reset, file);
- fputc('\n', file);
+ putc('\n', file);
if (!had_nl)
fputs("\\ No newline at end of file\n", file);
}
diff --git a/log-tree.c b/log-tree.c
index 968428a137..5ce17ca3c3 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -560,10 +560,10 @@ void show_log(struct rev_info *opt)
show_children(opt, commit, abbrev_commit);
show_decorations(opt, commit);
if (opt->graph && !graph_is_commit_finished(opt->graph)) {
- fputc('\n', opt->diffopt.file);
+ putc('\n', opt->diffopt.file);
graph_show_remainder(opt->graph);
}
- fputc(opt->diffopt.line_termination, opt->diffopt.file);
+ putc(opt->diffopt.line_termination, opt->diffopt.file);
return;
}
@@ -589,7 +589,7 @@ void show_log(struct rev_info *opt)
if (opt->diffopt.line_termination == '\n' &&
!opt->missing_newline)
graph_show_padding(opt->graph);
- fputc(opt->diffopt.line_termination, opt->diffopt.file);
+ putc(opt->diffopt.line_termination, opt->diffopt.file);
}
opt->shown_one = 1;
@@ -626,9 +626,9 @@ void show_log(struct rev_info *opt)
fputs(diff_get_color_opt(&opt->diffopt, DIFF_RESET), opt->diffopt.file);
show_decorations(opt, commit);
if (opt->commit_format == CMIT_FMT_ONELINE) {
- fputc(' ', opt->diffopt.file);
+ putc(' ', opt->diffopt.file);
} else {
- fputc('\n', opt->diffopt.file);
+ putc('\n', opt->diffopt.file);
graph_show_oneline(opt->graph);
}
if (opt->reflog_info) {
@@ -722,7 +722,7 @@ void show_log(struct rev_info *opt)
if (opt->use_terminator && !commit_format_is_empty(opt->commit_format)) {
if (!opt->missing_newline)
graph_show_padding(opt->graph);
- fputc(opt->diffopt.line_termination, opt->diffopt.file);
+ putc(opt->diffopt.line_termination, opt->diffopt.file);
}
strbuf_release(&msgbuf);
@@ -775,7 +775,7 @@ int log_tree_diff_flush(struct rev_info *opt)
if (!opt->shown_dashes &&
(pch & opt->diffopt.output_format) == pch)
fprintf(opt->diffopt.file, "---");
- fputc('\n', opt->diffopt.file);
+ putc('\n', opt->diffopt.file);
}
}
diff_flush(&opt->diffopt);
@@ -882,7 +882,6 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit)
if (opt->track_linear && !opt->linear && opt->reverse_output_stage)
fprintf(opt->diffopt.file, "\n%s\n", opt->break_bar);
opt->loginfo = NULL;
- if (opt->diffopt.file == stdout)
- maybe_flush_or_die(stdout, "stdout");
+ maybe_flush_or_die(stdout, "log-tree output");
return shown;
}