...
1env GO111MODULE=on
2
3[!git] skip
4[short] skip
5
6# Testing git->module converter's generation of +incompatible tags; turn off proxy.
7env GOPROXY=direct
8env GOSUMDB=off
9
10# We can resolve the @master branch without unshallowing the local repository
11# (even with older gits), so try that before we do anything else.
12# (This replicates https://golang.org/issue/26713 with git 2.7.4.)
13go get vcs-test.golang.org/git/legacytest.git@master
14go list -m all
15stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.1-0\.\d{14}-7303f7796364\+incompatible$'
16
17# get should include incompatible tags in "latest" calculation.
18go mod edit -droprequire vcs-test.golang.org/git/legacytest.git
19go get vcs-test.golang.org/git/legacytest.git@latest
20go list
21go list -m all
22stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.0\+incompatible$'
23
24# v2.0.1-0.pseudo+incompatible
25go get ...test.git@7303f77
26go list -m all
27stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.1-0\.\d{14}-7303f7796364\+incompatible$'
28
29# v2.0.0+incompatible by tag+incompatible
30go get ...test.git@v2.0.0+incompatible
31go list -m all
32stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.0\+incompatible$'
33
34# v2.0.0+incompatible by tag
35go get ...test.git@v2.0.0
36go list -m all
37stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.0\+incompatible$'
38
39# v2.0.0+incompatible by hash (back on master)
40go get ...test.git@d7ae1e4
41go list -m all
42stdout '^vcs-test.golang.org/git/legacytest.git v2\.0\.0\+incompatible$'
43
44# v1.2.1-0.pseudo
45go get ...test.git@d2d4c3e
46go list -m all
47stdout '^vcs-test.golang.org/git/legacytest.git v1\.2\.1-0\.\d{14}-d2d4c3ea6623$'
48
49# v1.2.0
50go get ...test.git@9f6f860
51go list -m all
52stdout '^vcs-test.golang.org/git/legacytest.git v1\.2\.0$'
53
54# v1.1.0-pre.0.pseudo
55go get ...test.git@fb3c628
56go list -m all
57stdout '^vcs-test.golang.org/git/legacytest.git v1\.1\.0-pre\.0\.\d{14}-fb3c628075e3$'
58
59# v1.1.0-pre (no longer on master)
60go get ...test.git@731e3b1
61go list -m all
62stdout '^vcs-test.golang.org/git/legacytest.git v1\.1\.0-pre$'
63
64# v1.0.1-0.pseudo
65go get ...test.git@fa4f5d6
66go list -m all
67stdout '^vcs-test.golang.org/git/legacytest.git v1\.0\.1-0\.\d{14}-fa4f5d6a71c6$'
68
69# v1.0.0
70go get ...test.git@7fff7f3
71go list -m all
72stdout '^vcs-test.golang.org/git/legacytest.git v1\.0\.0$'
73
74# v0.0.0-pseudo
75go get ...test.git@52853eb
76go list -m all
77stdout '^vcs-test.golang.org/git/legacytest.git v0\.0\.0-\d{14}-52853eb7b552$'
78
79-- go.mod --
80module x
81-- x.go --
82package x
83import "vcs-test.golang.org/git/legacytest.git"
View as plain text