aboutsummaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-14 10:29:59 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-14 10:29:59 -0800
commita1d68bea891118bdaecb6dd77610e6daf2f7d53d (patch)
treec9fcf59d0b60c42afeafd0a68e13dc2f72521d0b /graph.c
parent55f9c8351d8bf0aca18cb3472ec081ad57c96543 (diff)
parent41ee2ad6cbebab0429248a14ec4e02afddd60dbe (diff)
downloadgit-a1d68bea891118bdaecb6dd77610e6daf2f7d53d.tar.xz
Merge branch 'jk/diff-graph-cleanup'
Refactors a lot of repetitive code sequence from the graph drawing code and adds it to the combined diff output. * jk/diff-graph-cleanup: combine-diff.c: teach combined diffs about line prefix diff.c: use diff_line_prefix() where applicable diff: add diff_line_prefix function diff.c: make constant string arguments const diff: write prefix to the correct file graph: output padding for merge subsequent parents
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/graph.c b/graph.c
index 391a712e5e..2a3fc5c0ec 100644
--- a/graph.c
+++ b/graph.c
@@ -1227,6 +1227,16 @@ void graph_show_commit(struct git_graph *graph)
if (!graph)
return;
+ /*
+ * When showing a diff of a merge against each of its parents, we
+ * are called once for each parent without graph_update having been
+ * called. In this case, simply output a single padding line.
+ */
+ if (graph_is_commit_finished(graph)) {
+ graph_show_padding(graph);
+ shown_commit_line = 1;
+ }
+
while (!shown_commit_line && !graph_is_commit_finished(graph)) {
shown_commit_line = graph_next_line(graph, &msgbuf);
fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);