#!/bin/sh
#
# Graph test: many merges

. libtest.sh

test_graph <<EOF
commit P N O
    Commit P - Merge O into N
commit O M
    Commit O after M
commit N L M
    Commit N - Merge M into L
commit M K
    Commit M after K
commit L J K
    Commit L - Merge K into J
commit K E J
    Commit K - Merge J into E
commit J I F
    Commit J - Merge F into I
commit I C H
    Commit I - Merge H into C
commit H G
    Commit H after G
commit F C
    Commit F after C
commit E D
    Commit E after D
commit C A B
    Commit C - Merge B into A
commit D Q
    Commit D after Q
commit B R
    Commit B after R
commit R A
    Commit R after A
commit Q X
    Commit Q after X
commit A S T
    Commit A - Merge T into S
commit T U
    Commit T after U
commit U V
    Commit U after V
commit V W
    Commit V after W
*   [33mb132970[m[33m ([1;36mHEAD[m[33m)[m Merge pull request #22 in COM/compliance_checks from feature/6963/fireeye to master
[31m|[m[32m\[m  
[31m|[m * [33ma300155[m[33m ([1;31morigin/feature/6963/fireeye[m[33m, [1;32mfeature/6963/fireeye[m[33m)[m When no lines found for info report, say so
* [32m|[m   [33macdad90[m Merge pull request #21 in COM/compliance_checks from feature/6963/fireeye to master
[33m|[m[32m\[m [32m\[m  
[33m|[m [32m|[m[32m/[m  
[33m|[m * [33m27ea95d[m Reduce output lines on failure and improve status messages
* [34m|[m   [33m1c4f527[m Merge pull request #10 in COM/compliance_checks from feature/6963/fireeye to master
[35m|[m[34m\[m [34m\[m  
[35m|[m [34m|[m[34m/[m  
[35m|[m *   [33mbcad23b[m Merge branch 'master' into feature/6963/fireeye
[35m|[m [1;31m|[m[35m\[m  
[35m|[m [1;31m|[m[35m/[m  
[35m|[m[35m/[m[1;31m|[m   
* [1;31m|[m   [33m4d124b1[m Merge pull request #19 in COM/compliance_checks from pa_typo to master
[1;33m|[m[1;34m\[m [1;31m\[m  
[1;33m|[m * [1;31m|[m [33m6648aeb[m fix typo
* [1;34m|[m [1;31m|[m   [33m8bba33d[m Merge pull request #20 in COM/compliance_checks from 2012typo to master
[1;34m|[m[1;36m\[m [1;34m\[m [1;31m\[m  
[1;34m|[m [1;36m|[m[1;34m/[m [1;31m/[m  
[1;34m|[m[1;34m/[m[1;36m|[m [1;31m|[m   
[1;34m|[m * [1;31m|[m [33m0b7d81c[m fixed typo
* [1;36m|[m [1;31m|[m   [33m04d6735[m Merge pull request #18 in COM/compliance_checks from procurve_naid to master
[31m|[m[32m\[m [1;36m\[m [1;31m\[m  
[31m|[m * [1;36m|[m [1;31m|[m [33md6c83d9[m Cleaned up the reference field indentation.
EOF

assert_equals stdout <<EOF
●─╮ Commit P - Merge O into N
│ ● Commit O after M
●─│─╮ Commit N - Merge M into L
│ ●─╯ Commit M after K
●─│─╮ Commit L - Merge K into J
│ ●─╯ Commit K - Merge J into E
●─│─╯ Commit J - Merge F into I
●─│─│─╮ Commit I - Merge H into C
│ │ │ ● Commit H after G
│ │ ● │ Commit F after C
│ ● │ │ Commit E after D
●─│─╯ │ Commit C - Merge B into A
│ ● │ │ Commit D after Q
│ │ ● │ Commit B after R
│ │ ● │ Commit R after A
│ ● │ │ Commit Q after X
●─│─╯ │ Commit A - Merge T into S
│ │ ● │ Commit T after U
│ │ ● │ Commit U after V
│ │ ● │ Commit V after W
EOF
