| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='push to group' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success setup ' |
| 8 | for i in 1 2 3 |
| 9 | do |
| 10 | git init dest-$i && |
| 11 | git -C dest-$i symbolic-ref HEAD refs/heads/not-a-branch || |
| 12 | return 1 |
| 13 | done && |
| 14 | test_tick && |
| 15 | git commit --allow-empty -m "initial" && |
| 16 | git config set --append remote.them.pushurl "file://$(pwd)/dest-1" && |
| 17 | git config set --append remote.them.pushurl "file://$(pwd)/dest-2" && |
| 18 | git config set --append remote.them.pushurl "file://$(pwd)/dest-3" && |
| 19 | git config set --append remote.them.push "+refs/heads/*:refs/heads/*" |
| 20 | ' |
| 21 | |
| 22 | test_expect_success 'push to group' ' |
| 23 | git push them && |
| 24 | j= && |
| 25 | for i in 1 2 3 |
| 26 | do |
| 27 | git -C dest-$i for-each-ref >actual-$i && |
| 28 | if test -n "$j" |
| 29 | then |
| 30 | test_cmp actual-$j actual-$i |
| 31 | else |
| 32 | cat actual-$i |
| 33 | fi && |
| 34 | j=$i || |
| 35 | return 1 |
| 36 | done |
| 37 | ' |
| 38 | |
| 39 | test_done |