Merge branch 'cs/http-use-basic-after-failed-negotiate'
[alt-git.git] / t / t3202-show-branch-octopus.sh
blob5cb0126cfede51be35f0abe114b6b7ea576df68c
1 #!/bin/sh
3 test_description='test show-branch with more than 8 heads'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 . ./test-lib.sh
10 numbers="1 2 3 4 5 6 7 8 9 10"
12 test_expect_success 'setup' '
14 > file &&
15 git add file &&
16 test_tick &&
17 git commit -m initial &&
19 for i in $numbers
21 git checkout -b branch$i main &&
22 > file$i &&
23 git add file$i &&
24 test_tick &&
25 git commit -m branch$i || return 1
26 done
30 cat > expect << EOF
31 ! [branch1] branch1
32 ! [branch2] branch2
33 ! [branch3] branch3
34 ! [branch4] branch4
35 ! [branch5] branch5
36 ! [branch6] branch6
37 ! [branch7] branch7
38 ! [branch8] branch8
39 ! [branch9] branch9
40 * [branch10] branch10
41 ----------
42 * [branch10] branch10
43 + [branch9] branch9
44 + [branch8] branch8
45 + [branch7] branch7
46 + [branch6] branch6
47 + [branch5] branch5
48 + [branch4] branch4
49 + [branch3] branch3
50 + [branch2] branch2
51 + [branch1] branch1
52 +++++++++* [branch10^] initial
53 EOF
55 test_expect_success 'show-branch with more than 8 branches' '
57 git show-branch $(for i in $numbers; do echo branch$i; done) > out &&
58 test_cmp expect out
62 test_expect_success 'show-branch with showbranch.default' '
63 for i in $numbers; do
64 git config --add showbranch.default branch$i
65 done &&
66 git show-branch >out &&
67 test_cmp expect out
70 test_done