summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorHemmo Nieminen <hemmo.nieminen@iki.fi>2013-10-16 08:28:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-10-18 19:48:48 (GMT)
commit339c17bc7690b5436ac61c996cede3d52c85b50d (patch)
tree3f556a21e2693a3ec95a4104ec2adce6436a7065 /graph.c
parente45bda876ae2e39ac1e11ba1609f2c363ad4959a (diff)
downloadgit-339c17bc7690b5436ac61c996cede3d52c85b50d.zip
git-339c17bc7690b5436ac61c996cede3d52c85b50d.tar.gz
git-339c17bc7690b5436ac61c996cede3d52c85b50d.tar.bz2
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 <hemmo.nieminen@iki.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/graph.c b/graph.c
index b24d04c..6404331 100644
--- a/graph.c
+++ b/graph.c
@@ -801,10 +801,10 @@ static int graph_draw_octopus_merge(struct git_graph *graph,
int num_dashes =
((graph->num_parents - dashless_commits) * 2) - 1;
for (i = 0; i < num_dashes; i++) {
- col_num = (i / 2) + dashless_commits;
+ col_num = (i / 2) + dashless_commits + graph->commit_index;
strbuf_write_column(sb, &graph->new_columns[col_num], '-');
}
- col_num = (i / 2) + dashless_commits;
+ col_num = (i / 2) + dashless_commits + graph->commit_index;
strbuf_write_column(sb, &graph->new_columns[col_num], '.');
return num_dashes + 1;
}