| 1526 | } |
| 1527 | |
| 1528 | void graph_show_commit(struct git_graph *graph) |
| 1529 | { |
| 1530 | struct strbuf msgbuf = STRBUF_INIT; |
| 1531 | int shown_commit_line = 0; |
| 1532 | |
| 1533 | graph_show_line_prefix(default_diffopt); |
| 1534 | |
| 1535 | if (!graph) |
| 1536 | return; |
| 1537 | |
| 1538 | /* |
| 1539 | * When showing a diff of a merge against each of its parents, we |
| 1540 | * are called once for each parent without graph_update having been |
| 1541 | * called. In this case, simply output a single padding line. |
| 1542 | */ |
| 1543 | if (graph_is_commit_finished(graph)) { |
| 1544 | graph_show_padding(graph); |
| 1545 | shown_commit_line = 1; |
| 1546 | } |
| 1547 | |
| 1548 | while (!shown_commit_line && !graph_is_commit_finished(graph)) { |
| 1549 | shown_commit_line = graph_next_line(graph, &msgbuf); |
| 1550 | fwrite(msgbuf.buf, sizeof(char), msgbuf.len, |
| 1551 | graph->revs->diffopt.file); |
| 1552 | if (!shown_commit_line) { |
| 1553 | putc('\n', graph->revs->diffopt.file); |
| 1554 | graph_show_line_prefix(&graph->revs->diffopt); |
| 1555 | } |
| 1556 | strbuf_setlen(&msgbuf, 0); |
| 1557 | } |
| 1558 | |
| 1559 | strbuf_release(&msgbuf); |
| 1560 | } |
| 1561 | |
| 1562 | void graph_show_oneline(struct git_graph *graph) |
| 1563 | { |
no test coverage detected