Merge branch 'ls/packet-line-protocol-doc-fix'
[git] / t / t5507-remote-environment.sh
1 #!/bin/sh
2
3 test_description='check environment showed to remote side of transports'
4 . ./test-lib.sh
5
6 test_expect_success 'set up "remote" push situation' '
7         test_commit one &&
8         git config push.default current &&
9         git init remote
10 '
11
12 test_expect_success 'set up fake ssh' '
13         GIT_SSH_COMMAND="f() {
14                 cd \"\$TRASH_DIRECTORY\" &&
15                 eval \"\$2\"
16         }; f" &&
17         export GIT_SSH_COMMAND &&
18         export TRASH_DIRECTORY
19 '
20
21 # due to receive.denyCurrentBranch=true
22 test_expect_success 'confirm default push fails' '
23         test_must_fail git push remote
24 '
25
26 test_expect_success 'config does not travel over same-machine push' '
27         test_must_fail git -c receive.denyCurrentBranch=false push remote
28 '
29
30 test_expect_success 'config does not travel over ssh push' '
31         test_must_fail git -c receive.denyCurrentBranch=false push host:remote
32 '
33
34 test_done