[release-branch.go1.21] cmd/go/internal/modfetch/codehost: add new git tags before statLocal instead of after
gitRepo.statLocal reports tag and version information.
If we are statting a hash that corresponds to a tag, we need to add that tag
before calling statLocal so that it can be included in that information.
For #53955.
For #56881.
For #64586
Change-Id: I69a71428e6ed9096d4cb8ed1bb79531415ff06c1
Reviewed-on: https://go-review.googlesource.com/c/go/+/547155
Auto-Submit: Bryan Mills <bcmills@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
(cherry picked from commit
7b5a3733fce46aa44449c5ba28876f5a1e630650)
Reviewed-on: https://go-review.googlesource.com/c/go/+/585815
Reviewed-by: Sam Thanawalla <samthanawalla@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>