| 1647 | } |
| 1648 | |
| 1649 | void graph_show_commit_msg(struct git_graph *graph, |
| 1650 | FILE *file, |
| 1651 | struct strbuf const *sb) |
| 1652 | { |
| 1653 | int newline_terminated; |
| 1654 | |
| 1655 | /* |
| 1656 | * Show the commit message |
| 1657 | */ |
| 1658 | graph_show_strbuf(graph, file, sb); |
| 1659 | |
| 1660 | if (!graph) |
| 1661 | return; |
| 1662 | |
| 1663 | newline_terminated = (sb->len && sb->buf[sb->len - 1] == '\n'); |
| 1664 | |
| 1665 | /* |
| 1666 | * If there is more output needed for this commit, show it now |
| 1667 | */ |
| 1668 | if (!graph_is_commit_finished(graph)) { |
| 1669 | /* |
| 1670 | * If sb doesn't have a terminating newline, print one now, |
| 1671 | * so we can start the remainder of the graph output on a |
| 1672 | * new line. |
| 1673 | */ |
| 1674 | if (!newline_terminated) |
| 1675 | putc('\n', file); |
| 1676 | |
| 1677 | graph_show_remainder(graph); |
| 1678 | |
| 1679 | /* |
| 1680 | * If sb ends with a newline, our output should too. |
| 1681 | */ |
| 1682 | if (newline_terminated) |
| 1683 | putc('\n', file); |
| 1684 | } |
| 1685 | } |
no test coverage detected