3 test_description
='fetching and pushing, with or without wildcard'
18 test_expect_success setup
'
23 git commit -a -m repo &&
24 the_commit=$(git show-ref -s --verify refs/heads/master)
28 test_expect_success
'fetch without wildcard' '
32 git fetch .. refs/heads/master:refs/remotes/origin/master &&
34 r=$(git show-ref -s --verify refs/remotes/origin/master) &&
35 test "z$r" = "z$the_commit" &&
37 test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
41 test_expect_success
'fetch with wildcard' '
45 git config remote.up.url .. &&
46 git config remote.up.fetch "refs/heads/*:refs/remotes/origin/*" &&
49 r=$(git show-ref -s --verify refs/remotes/origin/master) &&
50 test "z$r" = "z$the_commit" &&
52 test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
56 test_expect_success
'push without wildcard' '
59 git push testrepo refs/heads/master:refs/remotes/origin/master &&
62 r=$(git show-ref -s --verify refs/remotes/origin/master) &&
63 test "z$r" = "z$the_commit" &&
65 test 1 = $(git for-each-ref refs/remotes/origin | wc -l)
69 test_expect_success
'push with wildcard' '
72 git push testrepo "refs/heads/*:refs/remotes/origin/*" &&
75 r=$(git show-ref -s --verify refs/remotes/origin/master) &&
76 test "z$r" = "z$the_commit" &&
78 test 1 = $(git for-each-ref refs/remotes/origin | wc -l)