3 test_description
='git log --graph of skewed left octopus merge.'
7 test_expect_success
'set up merge history' '
8 cat >expect.uncolored <<-\EOF &&
22 cat >expect.colors <<-\EOF &&
24 <RED>|<RESET> *<BLUE>-<RESET><BLUE>-<RESET><MAGENTA>-<RESET><MAGENTA>.<RESET> octopus-merge
25 <RED>|<RESET> <RED>|<RESET><YELLOW>\<RESET> <BLUE>\<RESET> <MAGENTA>\<RESET>
26 <RED>|<RESET><RED>/<RESET> <YELLOW>/<RESET> <BLUE>/<RESET> <MAGENTA>/<RESET>
27 <RED>|<RESET> <YELLOW>|<RESET> <BLUE>|<RESET> * 4
28 <RED>|<RESET> <YELLOW>|<RESET> * <MAGENTA>|<RESET> 3
29 <RED>|<RESET> <YELLOW>|<RESET> <MAGENTA>|<RESET><MAGENTA>/<RESET>
30 <RED>|<RESET> * <MAGENTA>|<RESET> 2
31 <RED>|<RESET> <MAGENTA>|<RESET><MAGENTA>/<RESET>
33 <MAGENTA>|<RESET><MAGENTA>/<RESET>
36 test_commit initial &&
38 git checkout master -b $i || return $?
39 # Make tag name different from branch name, to avoid
40 # ambiguity error when calling checkout.
41 test_commit $i $i $i tag$i || return $?
43 git checkout 1 -b merge &&
45 git merge -m octopus-merge 1 2 3 4 &&
46 git checkout 1 -b L &&
50 test_expect_success
'log --graph with tricky octopus merge with colors' '
51 test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
52 git log --color=always --graph --date-order --pretty=tformat:%s --all >actual.colors.raw &&
53 test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
54 test_cmp expect.colors actual.colors
57 test_expect_success
'log --graph with tricky octopus merge, no color' '
58 git log --color=never --graph --date-order --pretty=tformat:%s --all >actual.raw &&
59 sed "s/ *\$//" actual.raw >actual &&
60 test_cmp expect.uncolored actual
63 # Repeat the previous two tests with "normal" octopus merge (i.e.,
64 # without the first parent skewing to the "left" branch column).
66 test_expect_success
'log --graph with normal octopus merge, no color' '
67 cat >expect.uncolored <<-\EOF &&
79 git log --color=never --graph --date-order --pretty=tformat:%s merge >actual.raw &&
80 sed "s/ *\$//" actual.raw >actual &&
81 test_cmp expect.uncolored actual
84 test_expect_success
'log --graph with normal octopus merge with colors' '
85 cat >expect.colors <<-\EOF &&
86 *<YELLOW>-<RESET><YELLOW>-<RESET><BLUE>-<RESET><BLUE>.<RESET> octopus-merge
87 <RED>|<RESET><GREEN>\<RESET> <YELLOW>\<RESET> <BLUE>\<RESET>
88 <RED>|<RESET> <GREEN>|<RESET> <YELLOW>|<RESET> * 4
89 <RED>|<RESET> <GREEN>|<RESET> * <BLUE>|<RESET> 3
90 <RED>|<RESET> <GREEN>|<RESET> <BLUE>|<RESET><BLUE>/<RESET>
91 <RED>|<RESET> * <BLUE>|<RESET> 2
92 <RED>|<RESET> <BLUE>|<RESET><BLUE>/<RESET>
94 <BLUE>|<RESET><BLUE>/<RESET>
97 test_config log.graphColors red,green,yellow,blue,magenta,cyan &&
98 git log --color=always --graph --date-order --pretty=tformat:%s merge >actual.colors.raw &&
99 test_decode_color <actual.colors.raw | sed "s/ *\$//" >actual.colors &&
100 test_cmp expect.colors actual.colors