Skip to content

Commit

Permalink
cmd/go/internal/modfetch/codehost: ignore incomplete semver tags in R…
Browse files Browse the repository at this point in the history
…ecentTag

Fixes #31965

Change-Id: I2126903196b630c0bee2c022be1a818e0856ce3b
Reviewed-on: https://go-review.googlesource.com/c/go/+/176539
Run-TryBot: Bryan C. Mills <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Jay Conrod <[email protected]>
  • Loading branch information
Bryan C. Mills committed May 13, 2019
1 parent 5f320f9 commit 8d212c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cmd/go/internal/modfetch/codehost/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ func (r *gitRepo) RecentTag(rev, prefix string) (tag string, err error) {
}

semtag := line[len(prefix):]
if semver.IsValid(semtag) {
// Consider only tags that are valid and complete (not just major.minor prefixes).
if c := semver.Canonical(semtag); c != "" && strings.HasPrefix(semtag, c) {
highest = semver.Max(highest, semtag)
}
}
Expand Down

0 comments on commit 8d212c3

Please sign in to comment.