diff --git a/pkg/git/gogit/checkout.go b/pkg/git/gogit/checkout.go index fdf91027..e767b37a 100644 --- a/pkg/git/gogit/checkout.go +++ b/pkg/git/gogit/checkout.go @@ -212,7 +212,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, auth *g } var matchedVersions semver.Collection - for tag, _ := range tags { + for tag := range tags { v, err := version.ParseVersion(tag) if err != nil { continue @@ -239,7 +239,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, auth *g // versions into a chronological order. This is especially important for // versions that differ only by build metadata, because it is not considered // a part of the comparable version in Semver - return tagTimestamps[left.String()].Before(tagTimestamps[right.String()]) + return tagTimestamps[left.Original()].Before(tagTimestamps[right.Original()]) }) v := matchedVersions[len(matchedVersions)-1] t := v.Original()