3 test_description='push with --set-publish'
7 test_expect_success 'setup bare parent' '
8 git init --bare parent &&
9 git remote add publish parent
12 test_expect_success 'setup local commit' '
19 (echo $2; echo $3) >expect.$1
20 (git config branch.$1.pushremote
21 git config branch.$1.push) >actual.$1
22 test_cmp expect.$1 actual.$1
25 test_expect_success 'push -p master:master' '
26 git push -p publish master:master &&
27 check_config master publish refs/heads/master
30 test_expect_success 'push -u master:other' '
31 git push -p publish master:other &&
32 check_config master publish refs/heads/other
35 test_expect_success 'push -p --dry-run master:otherX' '
36 git push -p --dry-run publish master:otherX &&
37 check_config master publish refs/heads/other
40 test_expect_success 'push -p master2:master2' '
42 git push -p publish master2:master2 &&
43 check_config master2 publish refs/heads/master2
46 test_expect_success 'push -p master2:other2' '
47 git push -p publish master2:other2 &&
48 check_config master2 publish refs/heads/other2
51 test_expect_success 'push -p :master2' '
52 git push -p publish :master2 &&
53 check_config master2 publish refs/heads/other2
56 test_expect_success 'push -u --all' '
60 check_config all1 publish refs/heads/all1 &&
61 check_config all2 publish refs/heads/all2
64 test_expect_success 'push -p HEAD' '
65 git checkout -b headbranch &&
66 git push -p publish HEAD &&
67 check_config headbranch publish refs/heads/headbranch