| 1 |
# Regression test for https://go.dev/issue/63845: |
| 2 |
# If 'git ls-remote' fails for all secure protocols, |
| 3 |
# we should fail instead of falling back to an arbitrary protocol. |
| 4 |
# |
| 5 |
# Note that this test does not use the local vcweb test server |
| 6 |
# (vcs-test.golang.org), because the hook for redirecting to that |
| 7 |
# server bypasses the "ping to determine protocol" logic |
| 8 |
# in cmd/go/internal/vcs. |
| 9 |
|
| 10 |
[!net:golang.org] skip |
| 11 |
[!git] skip |
| 12 |
[short] skip 'tries to access a nonexistent external Git repo' |
| 13 |
|
| 14 |
env GOPRIVATE=golang.org |
| 15 |
env CURLOPT_TIMEOUT_MS=100 |
| 16 |
env GIT_SSH_COMMAND=false |
| 17 |
|
| 18 |
! go get -x golang.org/nonexist.git@latest |
| 19 |
stderr '^git ls-remote https://golang.org/nonexist$' |
| 20 |
stderr '^git ls-remote git\+ssh://golang.org/nonexist' |
| 21 |
stderr '^git ls-remote ssh://golang.org/nonexist$' |
| 22 |
! stderr 'git://' |
| 23 |
stderr '^go: golang.org/nonexist.git@latest: no secure protocol found for repository$' |
| 24 |
|
| 25 |
-- go.mod -- |
| 26 |
module example |
| 27 |
|
| 28 |
go 1.19 |