-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Describe the bug
There is a regression in Nix 2.31.0 (caused by #13729) in how ?ref=x is handled, where x:
- Does not begin with
refs/heads/orrefs/tags. - Starts with an uppercase character.
- Contains a
/.
Steps To Reproduce
$ nix run github:NixOS/nix?ref=refs/tags/2.31.0 -- eval --impure --expr 'builtins.fetchTree "git+https://github.com/joshuaspence/renovate-nix-test?ref=A/b"'
error:
… while calling the 'fetchTree' builtin
at «string»:1:1:
1| builtins.fetchTree "git+https://github.com/joshuaspence/renovate-nix-test?ref=A/b"
| ^
error: invalid Git branch/tag name 'A/b'
Expected behavior
$ nix run github:NixOS/nix?ref=refs/tags/2.30.3 -- eval --impure --expr 'builtins.fetchTree "git+https://github.com/joshuaspence/renovate-nix-test?ref=A/b"'
{ lastModified = 1758840150; lastModifiedDate = "20250925224230"; narHash = "sha256-qYyrO6jtEOPxRmWJIutPcz/BOJZiUxIjFTvJsCCdBd8="; outPath = "/nix/store/2nr406sbalbkrvw30dyb3jwckxqmqrcv-source"; rev = "381789e95ded5d632c348bf288d8a01f5b034107"; revCount = 14; shortRev = "381789e"; submodules = false; }
Metadata
Additional context
This reproduces in Nix 2.32.0 as well.
$ nix run github:NixOS/nix?ref=refs/tags/2.32.0 -- eval --impure --expr 'builtins.fetchTree "git+https://github.com/joshuaspence/renovate-nix-test?ref=A/b"'
error:
… while calling the 'fetchTree' builtin
at «string»:1:1:
1| builtins.fetchTree "git+https://github.com/joshuaspence/renovate-nix-test?ref=A/b"
| ^
error: invalid Git branch/tag name 'A/b'
Checklist
- checked latest Nix manual (source)
- checked open bug issues and pull requests for possible duplicates
Add 👍 to issues you find important.
Reactions are currently unavailable