diff options
| author | Sean Liao <sean@liao.dev> | 2025-02-09 13:32:27 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-02-11 08:36:42 -0800 |
| commit | dcbdc1a2f7368ad8a9193e969cc76c7ffd2f7685 (patch) | |
| tree | 53593096ff4764117c41472af65190445956b62c /src | |
| parent | 887d9ef6101c6efeef00b0c7c80e634ff983fdcc (diff) | |
| download | go-dcbdc1a2f7368ad8a9193e969cc76c7ffd2f7685.tar.xz | |
cmd/go/internal/modload: don't set GIT_SSH_COMMAND
Allows git core.sshcommand to take effect when set by the user.
This was originally added to work around an issue in
OpenSSH < 7.3 (2016), see https://go.dev/issue/13453 .
A fixed version of OpenSSH should be widely available enough
that it is no longer necessary
Fixes #71482
Change-Id: I6f44cc354e8a4063e226cac78ec27117fcc40e93
Reviewed-on: https://go-review.googlesource.com/c/go/+/647995
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Daniel Martà <mvdan@mvdan.cc>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/internal/modload/init.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index 8fdcd0da63..5d01aedc2f 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -452,23 +452,6 @@ func Init() { os.Setenv("GIT_TERMINAL_PROMPT", "0") } - // Disable any ssh connection pooling by Git. - // If a Git subprocess forks a child into the background to cache a new connection, - // that child keeps stdout/stderr open. After the Git subprocess exits, - // os/exec expects to be able to read from the stdout/stderr pipe - // until EOF to get all the data that the Git subprocess wrote before exiting. - // The EOF doesn't come until the child exits too, because the child - // is holding the write end of the pipe. - // This is unfortunate, but it has come up at least twice - // (see golang.org/issue/13453 and golang.org/issue/16104) - // and confuses users when it does. - // If the user has explicitly set GIT_SSH or GIT_SSH_COMMAND, - // assume they know what they are doing and don't step on it. - // But default to turning off ControlMaster. - if os.Getenv("GIT_SSH") == "" && os.Getenv("GIT_SSH_COMMAND") == "" { - os.Setenv("GIT_SSH_COMMAND", "ssh -o ControlMaster=no -o BatchMode=yes") - } - if os.Getenv("GCM_INTERACTIVE") == "" { os.Setenv("GCM_INTERACTIVE", "never") } |
