Skip to content

Commit ec53e23

Browse files
Merge pull request #486 from ankitathomas/skippatch-fix
Bug 1889721: Check prerelease version for semver-skippatch mode
2 parents 3cafc8d + d8243c5 commit ec53e23

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/registry/bundlegraphloader.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, ann
153153
return graph, nil
154154
}
155155

156+
// isSkipPatchCandidate returns true if version is equal to toCompare
157+
// in major and minor positions and strictly greater in all others,
158+
// indicating that toCompare can be skipped over to version.
156159
func isSkipPatchCandidate(version, toCompare semver.Version) bool {
157-
return (version.Major == toCompare.Major) && (version.Minor == toCompare.Minor) && (version.Patch > toCompare.Patch)
160+
return (version.Major == toCompare.Major) && (version.Minor == toCompare.Minor) && version.GT(toCompare)
158161
}

0 commit comments

Comments
 (0)