ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
35.07k stars 2.56k forks source link

zig fetch: handle redirects for Git packages #22022

Closed ianprime0509 closed 3 days ago

ianprime0509 commented 3 days ago

Closes #21976


Manually tested with the linked issue's example (as well as on my personal projects to avoid any obvious regressions):

⬢ [ian@toolbox src]$ zig fetch git+https://codeberg.org/dude_the_builder/zg#v0.13.2
error: repository moved to codeberg.org/atman/zg
⬢ [ian@toolbox src]$ zig fetch git+https://codeberg.org/atman/zg#v0.13.2
122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40
⬢ [ian@toolbox src]$ ~/src/zig-worktrees/git-redirect/build/stage4/bin/zig fetch git+https://codeberg.org/dude_the_builder/zg#v0.13.2
122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40
⬢ [ian@toolbox src]$ ~/src/zig-worktrees/git-redirect/build/stage4/bin/zig fetch git+https://codeberg.org/atman/zg#v0.13.2
122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40
andrewrk commented 3 days ago

Thanks!