clone: teach --recurse-submodules to optionally take a pathspec
[git.git] / t / t5535-fetch-push-symref.sh
blob8ed58d27f24351b324051028372ac072ab9e5ea9
1 #!/bin/sh
3 test_description='avoiding conflicting update thru symref aliasing'
5 . ./test-lib.sh
7 test_expect_success 'setup' '
8 test_commit one &&
9 git clone . src &&
10 git clone src dst1 &&
11 git clone src dst2 &&
12 test_commit two &&
13 ( cd src && git pull )
16 test_expect_success 'push' '
18 cd src &&
19 git push ../dst1 "refs/remotes/*:refs/remotes/*"
20 ) &&
21 git ls-remote src "refs/remotes/*" >expect &&
22 git ls-remote dst1 "refs/remotes/*" >actual &&
23 test_cmp expect actual &&
24 ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
25 ( cd dst1 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
26 test_cmp expect actual
29 test_expect_success 'fetch' '
31 cd dst2 &&
32 git fetch ../src "refs/remotes/*:refs/remotes/*"
33 ) &&
34 git ls-remote src "refs/remotes/*" >expect &&
35 git ls-remote dst2 "refs/remotes/*" >actual &&
36 test_cmp expect actual &&
37 ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
38 ( cd dst2 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
39 test_cmp expect actual
42 test_done