graph API: fix a bug in the rendering of octopus merges
authorAllan Caffee <allan.caffee@gmail.com>
Wed, 22 Apr 2009 21:27:59 +0000 (17:27 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2009 00:49:56 +0000 (17:49 -0700)
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>
graph.c
t/t4202-log.sh

diff --git a/graph.c b/graph.c
index 31e09eb2c7953fdb1b8ff47db2145f72a248dcbe..b7879f8c66ee838f9603330b7083f65ff215012b 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -852,7 +852,7 @@ static void graph_output_commit_line(struct git_graph *graph, struct strbuf *sb)
                        graph_output_commit_char(graph, sb);
                        chars_written++;
 
-                       if (graph->num_parents > 3)
+                       if (graph->num_parents > 2)
                                chars_written += graph_draw_octopus_merge(graph,
                                                                          sb);
                } else if (seen_this && (graph->num_parents > 2)) {
index 46bd24f5025e3e8480e791259cb12e5cc30de58e..67f983fea405934c779eb5507182b02811081450 100755 (executable)
@@ -342,7 +342,7 @@ cat > expect <<\EOF
 * initial
 EOF
 
-test_expect_failure 'log --graph with merge' '
+test_expect_sucess 'log --graph with merge' '
        git log --graph --date-order --pretty=tformat:%s |
                sed "s/ *$//" >actual &&
        test_cmp expect actual