| 1620 | } |
| 1621 | |
| 1622 | static void graph_show_strbuf(struct git_graph *graph, |
| 1623 | FILE *file, |
| 1624 | struct strbuf const *sb) |
| 1625 | { |
| 1626 | char *p; |
| 1627 | |
| 1628 | /* |
| 1629 | * Print the strbuf line by line, |
| 1630 | * and display the graph info before each line but the first. |
| 1631 | */ |
| 1632 | p = sb->buf; |
| 1633 | while (p) { |
| 1634 | size_t len; |
| 1635 | char *next_p = strchr(p, '\n'); |
| 1636 | if (next_p) { |
| 1637 | next_p++; |
| 1638 | len = next_p - p; |
| 1639 | } else { |
| 1640 | len = (sb->buf + sb->len) - p; |
| 1641 | } |
| 1642 | fwrite(p, sizeof(char), len, file); |
| 1643 | if (next_p && *next_p != '\0') |
| 1644 | graph_show_oneline(graph); |
| 1645 | p = next_p; |
| 1646 | } |
| 1647 | } |
| 1648 | |
| 1649 | void graph_show_commit_msg(struct git_graph *graph, |
| 1650 | FILE *file, |
no test coverage detected