-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |