]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: make module@nonexistentversion failures reusable
authorRuss Cox <rsc@golang.org>
Fri, 1 Jul 2022 20:10:19 +0000 (16:10 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 5 Jul 2022 12:57:46 +0000 (12:57 +0000)
commitc1110910713766eb06d75ed48db3722d318a845e
treeec29695235a052387ebd8f1d0423db2a95fb5ddb
parent5f305ae8e5796ea3821088863a6842117c58da72
cmd/go: make module@nonexistentversion failures reusable

CL 411398 added the -reuse flag for reusing cached JSON output
when the remote Git repository has not changed. One case that was
not yet cached is a lookup of a nonexistent version.

This CL adds caching of failed lookups of nonexistent versions,
by saving a checksum of all the heads and tags refs on the remote
server (we never consider other kinds of refs). If none of those have
changed, then we don't need to download the full server.

Fixes #53644.

Change-Id: I428bbc8ec8475bd7d03788934d643e1e2be3add0
Reviewed-on: https://go-review.googlesource.com/c/go/+/415678
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/internal/modfetch/codehost/codehost.go
src/cmd/go/internal/modfetch/codehost/git.go
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/internal/modload/query.go
src/cmd/go/testdata/script/reuse_git.txt