Loading
Fix Git for Windows checksum update for rebuild (.windows.N) releases
What
update-checksums.sh and Dockerfile.windows assumed the MinGit asset filename always matches MinGit-<version>-<arch>.zip. That only holds for the first build of a Git for Windows release. Rebuilds append the build number to the filename:
| Tag | Asset filename |
|---|---|
v2.55.0.windows.1 |
MinGit-2.55.0-64-bit.zip |
v2.55.0.windows.2 |
MinGit-2.55.0.2-64-bit.zip |
As a result, the checksum grep found nothing for .windows.2, the script exited with an empty checksum, and Renovate reported it as an "Artifact update problem" (see !148 (merged)). Even if the checksum were supplied, the ADD URL in Dockerfile.windows would have 404'd on the rebuild release.
Change
- Compute
GIT_FILE_VERSION(version, plus.buildwhen the build is not1) and use it for both checksum extraction and the download URL. - Add a
GIT_FILE_VERSIONbuild arg maintained by the script alongsideGIT_VERSION.
Testing
- Ran
GIT_FOR_WINDOWS_TAG=v2.55.0.windows.2 ./scripts/update-checksums.sh: correctly extractse3ea2944…(amd64) /0b2b81fd…(arm64), matching the release notes. - Verified the resulting URL
https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.2/MinGit-2.55.0.2-64-bit.zipreturns HTTP 200. shellcheckclean.
Once merged, !148 (merged) can be rebased/retried and the artifact update will succeed.