]> Cypherpunks repositories - gostls13.git/commit
cmd/go: ignore retracted versions when converting revisions to versions
authorJay Conrod <jayconrod@google.com>
Fri, 9 Oct 2020 19:16:13 +0000 (15:16 -0400)
committerJay Conrod <jayconrod@google.com>
Fri, 9 Oct 2020 21:47:07 +0000 (21:47 +0000)
commit712cba3bf258c0c75bf1a638cb2119dbb11ed6c7
tree4e106596f5ee6cfa75dc6f1fdd1573a0cde272cd
parentd4a5797b8863185230d0e89da9a00fd17f04152a
cmd/go: ignore retracted versions when converting revisions to versions

When a module author retracts a version, the go command should act as
if it doesn't exist unless it's specifically requested.

When converting a revision to a version, we should ignore tags for
retracted versions. For example, if the tag v1.0.0 is retracted, and
branch B points to the same revision, we should convert B to a
pseudo-version, not v1.0.0. Similarly, if B points to a commit after
v1.0.0, we should not use v1.0.0 as the base; we can use an earlier
non-retracted tag or no base.

Fixes #41700

Change-Id: Ia596b05b0780e5acfe6616a04e94d24bd342fbae
Reviewed-on: https://go-review.googlesource.com/c/go/+/261079
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modfetch/codehost/codehost.go
src/cmd/go/internal/modfetch/codehost/git.go
src/cmd/go/internal/modfetch/codehost/vcs.go
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/testdata/script/mod_retract_pseudo_base.txt [new file with mode: 0644]