Skip to content

Commit 9ff5334

Browse files
committed
go-git: ensure original tag is used for TS lookup
Signed-off-by: Hidde Beydals <[email protected]>
1 parent 4c94f88 commit 9ff5334

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/git/gogit/checkout.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, auth *g
212212
}
213213

214214
var matchedVersions semver.Collection
215-
for tag, _ := range tags {
215+
for tag := range tags {
216216
v, err := version.ParseVersion(tag)
217217
if err != nil {
218218
continue
@@ -239,7 +239,7 @@ func (c *CheckoutSemVer) Checkout(ctx context.Context, path, url string, auth *g
239239
// versions into a chronological order. This is especially important for
240240
// versions that differ only by build metadata, because it is not considered
241241
// a part of the comparable version in Semver
242-
return tagTimestamps[left.String()].Before(tagTimestamps[right.String()])
242+
return tagTimestamps[left.Original()].Before(tagTimestamps[right.Original()])
243243
})
244244
v := matchedVersions[len(matchedVersions)-1]
245245
t := v.Original()

0 commit comments

Comments
 (0)