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 <allan.caffee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Allan Caffee 2009-04-22 17:27:59 -04:00 коммит произвёл Junio C Hamano
Родитель 36a31feae2
Коммит a6c1a3827c
2 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -852,7 +852,7 @@ static void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
graph_output_commit_char(graph, sb); graph_output_commit_char(graph, sb);
chars_written++; chars_written++;
if (graph->num_parents > 3) if (graph->num_parents > 2)
chars_written += graph_draw_octopus_merge(graph, chars_written += graph_draw_octopus_merge(graph,
sb); sb);
} else if (seen_this && (graph->num_parents > 2)) { } else if (seen_this && (graph->num_parents > 2)) {

Просмотреть файл

@ -342,7 +342,7 @@ cat > expect <<\EOF
* initial * initial
EOF EOF
test_expect_failure 'log --graph with merge' ' test_expect_sucess 'log --graph with merge' '
git log --graph --date-order --pretty=tformat:%s | git log --graph --date-order --pretty=tformat:%s |
sed "s/ *$//" >actual && sed "s/ *$//" >actual &&
test_cmp expect actual test_cmp expect actual