aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/mod_get_private_vcs.txt
blob: 75c776a7fa29c78d1856d381fa2a938b15348034 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
env GO111MODULE=on

# Testing stderr for git ls-remote; turn off proxy.
[!net] skip
[!exec:git] skip
env GOPROXY=direct

! go get github.com/golang/nonexist
stderr 'Confirm the import path was entered correctly.'
stderr 'If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.'
! stdout .

# Fetching a nonexistent commit should return an "unknown revision"
# error message.
! go get github.com/golang/term@86186f3aba07ed0212cfb944f3398997d2d07c6b
stderr '^go get: github.com/golang/term@86186f3aba07ed0212cfb944f3398997d2d07c6b: invalid version: unknown revision 86186f3aba07ed0212cfb944f3398997d2d07c6b$'
! stdout .

! go get github.com/golang/nonexist@master
stderr '^Confirm the import path was entered correctly.$'
stderr '^If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.$'
! stderr 'unknown revision'
! stdout .

[!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
# an error we don't already have special handling for. See golang/go#42751.
#
# 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'
! stdout .

-- $TMPDIR/git/config --
[url "git@github.com:"]
    insteadOf = https://github.com/