You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ nix repl
Welcome to Nix version 2.3.10. Type :? for help.
nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; }
{ outPath = "/nix/store/32wd1lrf55ymaz1aysrqffpxfgkwl6m4-source"; rev = "dd77f71afe6733e9790dd001125c423cb648b7ce"; revCount = 10127; shortRev = "dd77f71"; }
But unstable Nix 2.4pre20210308_1c0e3e4 (latest nixUnstable in release-20.09) breaks if given ref = "HEAD":
$ ./result/bin/nix repl
Welcome to Nix version 2.4pre20210308_1c0e3e4. Type :? for help.
nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; }
fetching Git repository 'https://github.com/NixOS/nix'fatal: couldn't find remote ref refs/heads/HEAD
error: program 'git' failed with exit code 128
Expected behavior
The documented default value of ref is HEAD, so Nix should also accept it when explicitly given. It works in stable Nix (2.3.10) but is broken in the latest nixUnstable code base.
Additional context
poetry2nix can end up calling builtins.fetchGit with ref = "HEAD", that's how I hit this issue.
The text was updated successfully, but these errors were encountered:
This fixes builtins.fetchGit { url = ...; ref = "HEAD"; }, that works in
stable nix (v2.3.10), but is broken in nix master:
$ ./result/bin/nix repl
Welcome to Nix version 2.4pre19700101_dd77f71. Type :? for help.
nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; }
fetching Git repository 'https://github.com/NixOS/nix'fatal: couldn't find remote ref refs/heads/HEAD
error: program 'git' failed with exit code 128
The documentation for builtins.fetchGit says ref = "HEAD" is the
default, so it should also be supported to explicitly pass it.
I came across this issue because poetry2nix can use ref = "HEAD" in some
situations.
FixesNixOS#4674.
This fixes builtins.fetchGit { url = ...; ref = "HEAD"; }, that works in
stable nix (v2.3.10), but is broken in nix master:
$ ./result/bin/nix repl
Welcome to Nix version 2.4pre19700101_dd77f71. Type :? for help.
nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; }
fetching Git repository 'https://github.com/NixOS/nix'fatal: couldn't find remote ref refs/heads/HEAD
error: program 'git' failed with exit code 128
The documentation for builtins.fetchGit says ref = "HEAD" is the
default, so it should also be supported to explicitly pass it.
I came across this issue because poetry2nix can use ref = "HEAD" in some
situations.
FixesNixOS#4674.
Describe the bug
Stable Nix 2.3.10 does it right:
But unstable Nix 2.4pre20210308_1c0e3e4 (latest nixUnstable in release-20.09) breaks if given
ref = "HEAD"
:Expected behavior
The documented default value of ref is HEAD, so Nix should also accept it when explicitly given. It works in stable Nix (2.3.10) but is broken in the latest nixUnstable code base.
Additional context
poetry2nix can end up calling builtins.fetchGit with
ref = "HEAD"
, that's how I hit this issue.The text was updated successfully, but these errors were encountered: