]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modfetch: re-resolve commit hashes in readDiskStat
authorBryan C. Mills <bcmills@google.com>
Wed, 12 Jun 2019 22:07:32 +0000 (18:07 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 19 Jun 2019 14:07:04 +0000 (14:07 +0000)
commite9188d1d18040bc6cb46065b2474664b8728a6df
treec9c185be0855d5aa5261646fd5085e9fd004486d
parent18107ed9fbdb0d2ae1006857e21a8a66882e12dd
cmd/go/internal/modfetch: re-resolve commit hashes in readDiskStat

Previously, when we resolved a commit hash (not a complete version),
we always checked the contents of the module cache for any
pseudo-version matching that commit.

However, there are many possible names for a given commit. Generally
the semantically-highest valid name is the best, and that may change
over time as new tags are added, so if we are able to fetch a better
name from upstream we should do so. Otherwise, we should fall back to
the highest appropriate name found in the cache.

Fixes #27171
Updates #27173

Change-Id: Ib5c7d99eb463af84674e969813039cbbee7e395b
Reviewed-on: https://go-review.googlesource.com/c/go/+/182178
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: roger peppe <rogpeppe@gmail.com>
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/testdata/script/mod_pseudo_cache.txt [new file with mode: 0644]