zig fetch: add support for SHA-256 Git repositories #22222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #21888
Note: I cherry-picked two commits from #21931 to ensure the Git tests updated in this PR are actually executed (one to execute the tests, and one to fix an unrelated issue causing some tests to fail due to undefined behavior). Those commits can be removed from this PR without impacting anything else if it's not desired.
I tried the following fetches as tests of the updated logic. Currently, Codeberg is the only Git hosting service I'm aware of which supports SHA-256 repositories, but if anyone is aware of others, I'd be happy to test them as well.
zig fetch git+https://github.com/ianprime0509/zig-xml
zig fetch git+https://github.com/ianprime0509/zig-xml#main
zig fetch git+https://github.com/ianprime0509/zig-xml#5656de48d8febd88f80ca9876591a2bec4daffad
zig fetch git+https://gitlab.gnome.org/GNOME/libxml2
zig fetch git+https://codeberg.org/ziglings/exercises
zig fetch git+https://git.sr.ht/~leon_plickat/zig-spoon
zig fetch git+https://bitbucket.org/archaistvolts2/zig-btree
zig fetch git+https://codeberg.org/GalaxyShard/zig-nds-bindings
zig fetch git+https://codeberg.org/GalaxyShard/zig-nds-bindings#main
zig fetch git+https://codeberg.org/GalaxyShard/zig-nds-bindings#297a06aab678414a350cc9bb68b5705b9969913601397c065dc847e1610d2200