Skip to content

Commit 0a2ba82

Browse files
committed
Merge branch 'rs/graph-simplify'
* rs/graph-simplify: graph: simplify graph_padding_line()
2 parents 507fe83 + 0176e7a commit 0a2ba82

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

graph.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,20 +1155,11 @@ static void graph_padding_line(struct git_graph *graph, struct strbuf *sb)
11551155
*/
11561156
for (i = 0; i < graph->num_columns; i++) {
11571157
struct column *col = &graph->columns[i];
1158-
struct commit *col_commit = col->commit;
1159-
if (col_commit == graph->commit) {
1160-
strbuf_write_column(sb, col, '|');
1161-
1162-
if (graph->num_parents < 3)
1163-
strbuf_addch(sb, ' ');
1164-
else {
1165-
int num_spaces = ((graph->num_parents - 2) * 2);
1166-
strbuf_addchars(sb, ' ', num_spaces);
1167-
}
1168-
} else {
1169-
strbuf_write_column(sb, col, '|');
1158+
strbuf_write_column(sb, col, '|');
1159+
if (col->commit == graph->commit && graph->num_parents > 2)
1160+
strbuf_addchars(sb, ' ', (graph->num_parents - 2) * 2);
1161+
else
11701162
strbuf_addch(sb, ' ');
1171-
}
11721163
}
11731164

11741165
graph_pad_horizontally(graph, sb, graph->num_columns);

0 commit comments

Comments
 (0)