]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: avoid password prompts in TestScript/mod_get_private_vcs
authorBryan C. Mills <bcmills@google.com>
Wed, 10 Mar 2021 04:31:41 +0000 (23:31 -0500)
committerBryan C. Mills <bcmills@google.com>
Wed, 10 Mar 2021 14:45:43 +0000 (14:45 +0000)
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>
src/cmd/go/testdata/script/mod_get_private_vcs.txt

index 8b01eac62c2935190f6e0b1363d796b923f73ec3..75c776a7fa29c78d1856d381fa2a938b15348034 100644 (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'