summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-16 21:32:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-16 21:32:35 (GMT)
commita3bbfe5d006f0f4deb59f92b3079ccf67764ea34 (patch)
tree041ac1a55425f43de25f13eb3cbb373217934c26 /t
parent14d5a3e47e38b29bf8aa7d6081d43ce0f24c3444 (diff)
parenta48b409f9ccd4e1957286ba064fd3a25a9ea2b56 (diff)
downloadgit-a3bbfe5d006f0f4deb59f92b3079ccf67764ea34.zip
git-a3bbfe5d006f0f4deb59f92b3079ccf67764ea34.tar.gz
git-a3bbfe5d006f0f4deb59f92b3079ccf67764ea34.tar.bz2
Merge branch 'jk/connect-clear-env' into maint
The ssh transport, just like any other transport over the network, did not clear GIT_* environment variables, but it is possible to use SendEnv and AcceptEnv to leak them to the remote invocation of Git, which is not a good idea at all. Explicitly clear them just like we do for the local transport. * jk/connect-clear-env: git_connect: clarify conn->use_shell flag git_connect: clear GIT_* environment for ssh
Diffstat (limited to 't')
-rwxr-xr-xt/t5507-remote-environment.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t5507-remote-environment.sh b/t/t5507-remote-environment.sh
new file mode 100755
index 0000000..e614929
--- /dev/null
+++ b/t/t5507-remote-environment.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+test_description='check environment showed to remote side of transports'
+. ./test-lib.sh
+
+test_expect_success 'set up "remote" push situation' '
+ test_commit one &&
+ git config push.default current &&
+ git init remote
+'
+
+test_expect_success 'set up fake ssh' '
+ GIT_SSH_COMMAND="f() {
+ cd \"\$TRASH_DIRECTORY\" &&
+ eval \"\$2\"
+ }; f" &&
+ export GIT_SSH_COMMAND &&
+ export TRASH_DIRECTORY
+'
+
+# due to receive.denyCurrentBranch=true
+test_expect_success 'confirm default push fails' '
+ test_must_fail git push remote
+'
+
+test_expect_success 'config does not travel over same-machine push' '
+ test_must_fail git -c receive.denyCurrentBranch=false push remote
+'
+
+test_expect_success 'config does not travel over ssh push' '
+ test_must_fail git -c receive.denyCurrentBranch=false push host:remote
+'
+
+test_done