Skip to content

Commit

Permalink
cmd/go/internal/modfetch: report error on failing to derive pseudo ve…
Browse files Browse the repository at this point in the history
…rsion from recent tag

The current implementation ignores the error when it tries to get
the recent tag on revisions, which results in incorrect pseudo
version (v0.0.0-) is derived.

Fixes #53935

Change-Id: I153d851eb913fb7e40051e194c92b9ca5bf0e906
GitHub-Last-Rev: 6ba1d90
GitHub-Pull-Request: #54701
Reviewed-on: https://go-review.googlesource.com/c/go/+/426079
Reviewed-by: Bryan Mills <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
Reviewed-by: David Chase <[email protected]>
Reviewed-by: Heschi Kreinick <[email protected]>
Reviewed-by: Damien Neil <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Bryan Mills <[email protected]>
  • Loading branch information
ZekeLu authored and gopherbot committed Aug 29, 2022
1 parent 4029124 commit 5cfeaed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cmd/go/internal/modfetch/coderepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,10 @@ func (r *codeRepo) convert(info *codehost.RevInfo, statVers string) (*RevInfo, e
return !isRetracted(v)
}
if pseudoBase == "" {
tag, _ := r.code.RecentTag(info.Name, tagPrefix, tagAllowed)
tag, err := r.code.RecentTag(info.Name, tagPrefix, tagAllowed)
if err != nil {
return nil, err
}
if tag != "" {
pseudoBase, _ = tagToVersion(tag)
}
Expand Down

0 comments on commit 5cfeaed

Please sign in to comment.