Johannes Schindelin | ce567d1 | 2008-07-23 01:50:35 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='test show-branch with more than 8 heads' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | numbers="1 2 3 4 5 6 7 8 9 10" |
| 8 | |
| 9 | test_expect_success 'setup' ' |
| 10 | |
| 11 | > file && |
| 12 | git add file && |
| 13 | test_tick && |
| 14 | git commit -m initial && |
| 15 | |
| 16 | for i in $numbers |
| 17 | do |
| 18 | git checkout -b branch$i master && |
| 19 | > file$i && |
| 20 | git add file$i && |
| 21 | test_tick && |
Jeff King | e6821d0 | 2015-03-25 01:29:52 -0400 | [diff] [blame] | 22 | git commit -m branch$i || return 1 |
Johannes Schindelin | ce567d1 | 2008-07-23 01:50:35 +0100 | [diff] [blame] | 23 | done |
| 24 | |
| 25 | ' |
| 26 | |
| 27 | cat > expect << EOF |
| 28 | ! [branch1] branch1 |
| 29 | ! [branch2] branch2 |
| 30 | ! [branch3] branch3 |
| 31 | ! [branch4] branch4 |
| 32 | ! [branch5] branch5 |
| 33 | ! [branch6] branch6 |
| 34 | ! [branch7] branch7 |
| 35 | ! [branch8] branch8 |
| 36 | ! [branch9] branch9 |
| 37 | * [branch10] branch10 |
| 38 | ---------- |
| 39 | * [branch10] branch10 |
| 40 | + [branch9] branch9 |
| 41 | + [branch8] branch8 |
| 42 | + [branch7] branch7 |
| 43 | + [branch6] branch6 |
| 44 | + [branch5] branch5 |
| 45 | + [branch4] branch4 |
| 46 | + [branch3] branch3 |
| 47 | + [branch2] branch2 |
| 48 | + [branch1] branch1 |
| 49 | +++++++++* [branch10^] initial |
| 50 | EOF |
| 51 | |
Johannes Schindelin | e358f3c | 2008-07-23 01:51:36 +0100 | [diff] [blame] | 52 | test_expect_success 'show-branch with more than 8 branches' ' |
Johannes Schindelin | ce567d1 | 2008-07-23 01:50:35 +0100 | [diff] [blame] | 53 | |
| 54 | git show-branch $(for i in $numbers; do echo branch$i; done) > out && |
| 55 | test_cmp expect out |
| 56 | |
| 57 | ' |
| 58 | |
Junio C Hamano | 3af1cae | 2009-06-08 23:26:44 -0700 | [diff] [blame] | 59 | test_expect_success 'show-branch with showbranch.default' ' |
| 60 | for i in $numbers; do |
| 61 | git config --add showbranch.default branch$i |
| 62 | done && |
| 63 | git show-branch >out && |
| 64 | test_cmp expect out |
| 65 | ' |
| 66 | |
Johannes Schindelin | ce567d1 | 2008-07-23 01:50:35 +0100 | [diff] [blame] | 67 | test_done |