MCPcopy Index your code
hub / github.com/git/git / graph_show_commit

Function graph_show_commit

graph.c:1528–1560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1526}
1527
1528void 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
1562void graph_show_oneline(struct git_graph *graph)
1563{

Callers 2

show_logFunction · 0.85
show_commitFunction · 0.85

Calls 6

graph_show_line_prefixFunction · 0.85
graph_is_commit_finishedFunction · 0.85
graph_show_paddingFunction · 0.85
graph_next_lineFunction · 0.85
strbuf_setlenFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected