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
Adding a git+file: input to a flake which refers to a repository which was cloned shallowly results in an error of the form:
error:
… while updating the lock file of flake 'git+file:///path/to/flake'
… while updating the flake input 'nixpkgs'
… while fetching the input 'git+file:///tmp/nixpkgs?shallow=1'
error: getting parent of Git commit '9fe5cee74762d8687c11151e2dfb88c77ac0b5d4': object not found - no match for id (2e7eed72914de2d0d4d38e4d545ca26702dba818)
In Nix 2.19.3 and before it works correctly.
Steps To Reproduce
Shallow-clone a git repository, e.g. git clone https://github.com/NixOS/nixpkgs --depth=1 /tmp/nixpkgs.
Make a flake that uses that repository as an input, with or without ?shallow=1, e.g.:
Qyriad
changed the title
Flake inputs cannot be local shallow git repositories (regression from 2.19.3)
Flake inputs cannot be local shallow git repositories (regression from 2.19.3, bisected)
Jan 21, 2024
Describe the bug
Adding a
git+file:
input to a flake which refers to a repository which was cloned shallowly results in an error of the form:In Nix 2.19.3 and before it works correctly.
Steps To Reproduce
git clone https://github.com/NixOS/nixpkgs --depth=1 /tmp/nixpkgs
.?shallow=1
, e.g.:nix flake update
in that flake directoryExpected behavior — Behavior on Nix 2.9.2:
The flake updates and locks successfully, outputting
Added input 'nixpkgs': git+file:///tmp/nixpkgs?ref…
(etc)nix-env --version
outputnix-env (Nix) 2.19.0pre20231031_ee36a44
Additional context
Bisect points to ee36a44 from #9240.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: