1
0
mirror of https://github.com/golang/go synced 2024-11-26 06:27:58 -07:00

cmd/go: avoid password prompts in TestScript/mod_get_private_vcs

In some cases, this test would prompt for interactive SSH passwords in
order to authenticate to github.com over SSH. Setting GIT_SSH_COMMAND
to /bin/false prevents that, while still provoking the desired Git
failure mode.

Updates #44904.

Change-Id: Idc9fe9f47d2ccb6c8a4ea988b73d9c8c774e4079
Reviewed-on: https://go-review.googlesource.com/c/go/+/300156
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Kevin Burke <kev@inburke.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Kevin Burke <kev@inburke.com>
This commit is contained in:
Bryan C. Mills 2021-03-09 23:31:41 -05:00
parent cf59850466
commit 30c28bbf05

View File

@ -22,7 +22,8 @@ stderr '^If this is a private repository, see https://golang.org/doc/faq#git_htt
! stderr 'unknown revision'
! stdout .
[!linux] stop
[!linux] stop # Needs XDG_CONFIG_HOME.
[!exec:false] stop
# Test that Git clone errors will be shown to the user instead of a generic
# "unknown revision" error. To do this we want to force git ls-remote to return
@ -31,6 +32,7 @@ stderr '^If this is a private repository, see https://golang.org/doc/faq#git_htt
# Set XDG_CONFIG_HOME to tell Git where to look for the git config file listed
# below, which turns on ssh.
env XDG_CONFIG_HOME=$TMPDIR
env GIT_SSH_COMMAND=false
! go install github.com/golang/nonexist@master
stderr 'fatal: Could not read from remote repository.'
! stderr 'unknown revision'