test: remove httpd tests that ask for user
[git] / t / t5544-push-publish.sh
1 #!/bin/sh
2
3 test_description='push with --set-publish'
4
5 . ./test-lib.sh
6
7 test_expect_success 'setup bare parent' '
8         git init --bare parent &&
9         git remote add publish parent
10 '
11
12 test_expect_success 'setup local commit' '
13         echo content >file &&
14         git add file &&
15         git commit -m one
16 '
17
18 check_config() {
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
23 }
24
25 test_expect_success 'push -p master:master' '
26         git push -p publish master:master &&
27         check_config master publish refs/heads/master
28 '
29
30 test_expect_success 'push -u master:other' '
31         git push -p publish master:other &&
32         check_config master publish refs/heads/other
33 '
34
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
38 '
39
40 test_expect_success 'push -p master2:master2' '
41         git branch master2 &&
42         git push -p publish master2:master2 &&
43         check_config master2 publish refs/heads/master2
44 '
45
46 test_expect_success 'push -p master2:other2' '
47         git push -p publish master2:other2 &&
48         check_config master2 publish refs/heads/other2
49 '
50
51 test_expect_success 'push -p :master2' '
52         git push -p publish :master2 &&
53         check_config master2 publish refs/heads/other2
54 '
55
56 test_expect_success 'push -u --all' '
57         git branch all1 &&
58         git branch all2 &&
59         git push -p --all &&
60         check_config all1 publish refs/heads/all1 &&
61         check_config all2 publish refs/heads/all2
62 '
63
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
68 '
69
70 test_done