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

Function graph_padding_line

graph.c:1480–1521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480static void graph_padding_line(struct git_graph *graph, struct strbuf *sb)
1481{
1482 int i;
1483 struct graph_line line = { .buf = sb, .width = 0 };
1484
1485 if (graph->state != GRAPH_COMMIT) {
1486 graph_next_line(graph, sb);
1487 return;
1488 }
1489
1490 /*
1491 * Output the row containing this commit
1492 * Iterate up to and including graph->num_columns,
1493 * since the current commit may not be in any of the existing
1494 * columns. (This happens when the current commit doesn't have any
1495 * children that we have already processed.)
1496 */
1497 for (i = 0; i < graph->num_columns; i++) {
1498 struct column *col = &graph->columns[i];
1499
1500 if (graph_needs_truncation(graph, i)) {
1501 graph_line_addstr(&line, "~ ");
1502 break;
1503 }
1504
1505 graph_line_write_column(&line, col, '|');
1506
1507 if (col->commit == graph->commit && graph->num_parents > 2) {
1508 int len = (graph->num_parents - 2) * 2;
1509 graph_line_addchars(&line, ' ', len);
1510 } else {
1511 graph_line_addch(&line, ' ');
1512 }
1513 }
1514
1515 graph_pad_horizontally(graph, &line);
1516
1517 /*
1518 * Update graph->prev_state since we have output a padding line
1519 */
1520 graph->prev_state = GRAPH_PADDING;
1521}
1522
1523int graph_is_commit_finished(struct git_graph const *graph)
1524{

Callers 2

graph_show_paddingFunction · 0.85

Calls 7

graph_next_lineFunction · 0.85
graph_needs_truncationFunction · 0.85
graph_line_addstrFunction · 0.85
graph_line_write_columnFunction · 0.85
graph_line_addcharsFunction · 0.85
graph_line_addchFunction · 0.85
graph_pad_horizontallyFunction · 0.85

Tested by

no test coverage detected