-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[release-branch.go1.21] cmd/go/internal/vcs: error out if the request…
…ed repo does not support a secure protocol Updates #63845. Fixes #63973. Change-Id: If86d6b13d3b55877b35c087112bd76388c9404b8 Reviewed-on: https://go-review.googlesource.com/c/go/+/539321 Reviewed-by: Michael Matloob <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Bryan Mills <[email protected]> (cherry picked from commit be26ae1) Reviewed-on: https://go-review.googlesource.com/c/go/+/540257 Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
- Loading branch information
Showing
2 changed files
with
47 additions
and
6 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,28 @@ | ||
# Regression test for https://go.dev/issue/63845: | ||
# If 'git ls-remote' fails for all secure protocols, | ||
# we should fail instead of falling back to an arbitrary protocol. | ||
# | ||
# Note that this test does not use the local vcweb test server | ||
# (vcs-test.golang.org), because the hook for redirecting to that | ||
# server bypasses the "ping to determine protocol" logic | ||
# in cmd/go/internal/vcs. | ||
|
||
[!net:golang.org] skip | ||
[!git] skip | ||
[short] skip 'tries to access a nonexistent external Git repo' | ||
|
||
env GOPRIVATE=golang.org | ||
env CURLOPT_TIMEOUT_MS=100 | ||
env GIT_SSH_COMMAND=false | ||
|
||
! go get -x golang.org/nonexist.git@latest | ||
stderr '^git ls-remote https://golang.org/nonexist$' | ||
stderr '^git ls-remote git\+ssh://golang.org/nonexist' | ||
stderr '^git ls-remote ssh://golang.org/nonexist$' | ||
! stderr 'git://' | ||
stderr '^go: golang.org/nonexist.git@latest: no secure protocol found for repository$' | ||
|
||
-- go.mod -- | ||
module example | ||
|
||
go 1.19 |