]> git.ipfire.org Git - thirdparty/git.git/blame - t/t3202-show-branch-octopus.sh
tests: mark tests relying on the current default for `init.defaultBranch`
[thirdparty/git.git] / t / t3202-show-branch-octopus.sh
CommitLineData
ce567d18
JS
1#!/bin/sh
2
3test_description='test show-branch with more than 8 heads'
4
334afbc7
JS
5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
ce567d18
JS
8. ./test-lib.sh
9
10numbers="1 2 3 4 5 6 7 8 9 10"
11
12test_expect_success 'setup' '
13
14 > file &&
15 git add file &&
16 test_tick &&
17 git commit -m initial &&
18
19 for i in $numbers
20 do
21 git checkout -b branch$i master &&
22 > file$i &&
23 git add file$i &&
24 test_tick &&
e6821d09 25 git commit -m branch$i || return 1
ce567d18
JS
26 done
27
28'
29
30cat > 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
53EOF
54
e358f3c3 55test_expect_success 'show-branch with more than 8 branches' '
ce567d18
JS
56
57 git show-branch $(for i in $numbers; do echo branch$i; done) > out &&
58 test_cmp expect out
59
60'
61
3af1cae4
JH
62test_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
68'
69
ce567d18 70test_done