diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-09-29 12:36:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-29 12:36:11 -0700 |
commit | 0a2ba82c76e0c28d58595fbdc2c43120f821b239 (patch) | |
tree | b1c69fc103d48c65d50b097cffbc279713b5bf22 /graph.c | |
parent | 507fe835ed0753ff266fdb998853cc5dea3758c6 (diff) | |
parent | 0176e7a71f2c722effde0ed22db3682400010911 (diff) | |
download | git-0a2ba82c76e0c28d58595fbdc2c43120f821b239.tar.gz |
Merge branch 'rs/graph-simplify'
* rs/graph-simplify:
graph: simplify graph_padding_line()
Diffstat (limited to 'graph.c')
-rw-r--r-- | graph.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -1155,20 +1155,11 @@ static void graph_padding_line(struct git_graph *graph, struct strbuf *sb) */ for (i = 0; i < graph->num_columns; i++) { struct column *col = &graph->columns[i]; - struct commit *col_commit = col->commit; - if (col_commit == graph->commit) { - strbuf_write_column(sb, col, '|'); - - if (graph->num_parents < 3) - strbuf_addch(sb, ' '); - else { - int num_spaces = ((graph->num_parents - 2) * 2); - strbuf_addchars(sb, ' ', num_spaces); - } - } else { - strbuf_write_column(sb, col, '|'); + strbuf_write_column(sb, col, '|'); + if (col->commit == graph->commit && graph->num_parents > 2) + strbuf_addchars(sb, ' ', (graph->num_parents - 2) * 2); + else strbuf_addch(sb, ' '); - } } graph_pad_horizontally(graph, sb, graph->num_columns); |