...

Text file src/cmd/go/testdata/script/mod_insecure_issue63845.txt

Documentation: cmd/go/testdata/script

     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
    14env GOPRIVATE=golang.org
    15env CURLOPT_TIMEOUT_MS=100
    16env GIT_SSH_COMMAND=false
    17
    18! go get -x golang.org/nonexist.git@latest
    19stderr '^git ls-remote https://golang.org/nonexist$'
    20stderr '^git ls-remote git\+ssh://golang.org/nonexist'
    21stderr '^git ls-remote ssh://golang.org/nonexist$'
    22! stderr 'git://'
    23stderr '^go: golang.org/nonexist.git@latest: no secure protocol found for repository$'
    24
    25-- go.mod --
    26module example
    27
    28go 1.19

View as plain text