Merge branch 'ja/doc-synopsis-markup'
[git/gitster.git] / t / t5535-fetch-push-symref.sh
blob7122af7fdb50acbd8279617f5741532280135ad8
1 #!/bin/sh
3 test_description='avoiding conflicting update through symref aliasing'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'setup' '
9 test_commit one &&
10 git clone . src &&
11 git clone src dst1 &&
12 git clone src dst2 &&
13 test_commit two &&
14 ( cd src && git pull )
17 test_expect_success 'push' '
19 cd src &&
20 git push ../dst1 "refs/remotes/*:refs/remotes/*"
21 ) &&
22 git ls-remote src "refs/remotes/*" >expect &&
23 git ls-remote dst1 "refs/remotes/*" >actual &&
24 test_cmp expect actual &&
25 ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
26 ( cd dst1 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
27 test_cmp expect actual
30 test_expect_success 'fetch' '
32 cd dst2 &&
33 git fetch ../src "refs/remotes/*:refs/remotes/*"
34 ) &&
35 git ls-remote src "refs/remotes/*" >expect &&
36 git ls-remote dst2 "refs/remotes/*" >actual &&
37 test_cmp expect actual &&
38 ( cd src && git symbolic-ref refs/remotes/origin/HEAD ) >expect &&
39 ( cd dst2 && git symbolic-ref refs/remotes/origin/HEAD ) >actual &&
40 test_cmp expect actual
43 test_done