Skip to content

Commit a6c1a38

Browse files
allancaffeegitster
authored andcommitted
graph API: fix a bug in the rendering of octopus merges
An off by one error was causing octopus merges with 3 parents to not be rendered correctly. This regression was introduced by 427fc5. Signed-off-by: Allan Caffee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 36a31fe commit a6c1a38

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ static void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
852852
graph_output_commit_char(graph, sb);
853853
chars_written++;
854854

855-
if (graph->num_parents > 3)
855+
if (graph->num_parents > 2)
856856
chars_written += graph_draw_octopus_merge(graph,
857857
sb);
858858
} else if (seen_this && (graph->num_parents > 2)) {

t/t4202-log.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ cat > expect <<\EOF
342342
* initial
343343
EOF
344344

345-
test_expect_failure 'log --graph with merge' '
345+
test_expect_sucess 'log --graph with merge' '
346346
git log --graph --date-order --pretty=tformat:%s |
347347
sed "s/ *$//" >actual &&
348348
test_cmp expect actual

0 commit comments

Comments
 (0)