Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 339c17b

Browse files
trhdgitster
authored andcommitted
graph: fix coloring around octopus merges
When drawing the graph of an octopus merge, we draw a horizontal line from parents 3 and above into the asterisk representing the commit. The sections of this line should be colored to match the graph lines coming in from above. However, if the commit is not in the left-most column we do not take into account the columns to the left of the commit when calculating these colors. Fix this by adding the appropriate offset to the column index used for calculating the color. Signed-off-by: Hemmo Nieminen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e45bda8 commit 339c17b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graph.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,10 +801,10 @@ static int graph_draw_octopus_merge(struct git_graph *graph,
801801
int num_dashes =
802802
((graph->num_parents - dashless_commits) * 2) - 1;
803803
for (i = 0; i < num_dashes; i++) {
804-
col_num = (i / 2) + dashless_commits;
804+
col_num = (i / 2) + dashless_commits + graph->commit_index;
805805
strbuf_write_column(sb, &graph->new_columns[col_num], '-');
806806
}
807-
col_num = (i / 2) + dashless_commits;
807+
col_num = (i / 2) + dashless_commits + graph->commit_index;
808808
strbuf_write_column(sb, &graph->new_columns[col_num], '.');
809809
return num_dashes + 1;
810810
}

0 commit comments

Comments
 (0)