fix(git): normalize .windows.N version suffix

Git for Windows uses tags like v2.53.0.windows.1. Node.js strips
".windows.1" and replaces ".windows.N" (N>1) with ".N".

Add NormalizeVersions to the git package and wire it into the classify
pipeline. Also add version normalization to comparecache so the
comparison uses canonical versions for both caches.

Remaining git diffs: data freshness (.windows.2 releases Go hasn't
fetched) and RC versions in Go that live doesn't have.
This commit is contained in:
AJ ONeal
2026-03-10 18:26:41 -06:00
parent ada10ed43a
commit 05abb1ffd2
3 changed files with 74 additions and 3 deletions

View File

@@ -47,6 +47,7 @@ func Package(pkg string, conf *installerconf.Conf, d *rawcache.Dir) ([]storage.A
}
TagVariants(pkg, assets)
NormalizeVersions(pkg, assets)
assets = ApplyConfig(assets, conf)
return assets, nil
}
@@ -85,6 +86,15 @@ func classifySource(pkg string, conf *installerconf.Conf, d *rawcache.Dir) ([]st
}
}
// NormalizeVersions applies package-specific version normalization.
// For example, Git for Windows strips ".windows.N" from version strings.
func NormalizeVersions(pkg string, assets []storage.Asset) {
switch pkg {
case "git":
git.NormalizeVersions(assets)
}
}
// TagVariants applies package-specific variant tags to classified assets.
// Each case delegates to a per-installer package under internal/releases/.
func TagVariants(pkg string, assets []storage.Asset) {