diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-01-08 12:44:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-08 12:44:13 -0800 |
commit | 1f5f3ffe5ceae12f0f7d78c42f657d9fee48fde2 (patch) | |
tree | 9cc28c86c02c4c3012a0fc04884f727eafa917e7 /graph.c | |
parent | Merge branch 'tm/doc-submodule-absorb-fix' (diff) | |
parent | graph: fix lack of color in horizontal lines (diff) | |
download | tgif-1f5f3ffe5ceae12f0f7d78c42f657d9fee48fde2.tar.xz |
Merge branch 'ds/graph-assert-fix'
Since recent updates to the log graph rendering code, drawing
certain merges started triggering an assert on a condition that
would no longer hold true, which has been corrected.
* ds/graph-assert-fix:
graph: fix lack of color in horizontal lines
graph: drop assert() for merge with two collapsing parents
Diffstat (limited to 'graph.c')
-rw-r--r-- | graph.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1063,7 +1063,7 @@ static void graph_output_post_merge_line(struct git_graph *graph, struct graph_l int i, j; struct commit_list *first_parent = first_interesting_parent(graph); - int seen_parent = 0; + struct column *parent_col = NULL; /* * Output the post-merge row @@ -1117,12 +1117,17 @@ static void graph_output_post_merge_line(struct git_graph *graph, struct graph_l graph_line_addch(line, ' '); } else { graph_line_write_column(line, col, '|'); - if (graph->merge_layout != 0 || i != graph->commit_index - 1) - graph_line_addch(line, seen_parent ? '_' : ' '); + if (graph->merge_layout != 0 || i != graph->commit_index - 1) { + if (parent_col) + graph_line_write_column( + line, parent_col, '_'); + else + graph_line_addch(line, ' '); + } } if (col_commit == first_parent->item) - seen_parent = 1; + parent_col = col; } /* @@ -1219,13 +1224,9 @@ static void graph_output_collapsing_line(struct git_graph *graph, struct graph_l * * The space just to the left of this * branch should always be empty. - * - * The branch to the left of that space - * should be our eventual target. */ assert(graph->mapping[i - 1] > target); assert(graph->mapping[i - 2] < 0); - assert(graph->mapping[i - 3] == target); graph->mapping[i - 2] = target; /* * Mark this branch as the horizontal edge to |