1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00

PosixSourceAccessor: Support roots that are not directories

We have to support this for `fetchTree { type = "file" }` (and
probably other types of trees that can have a non-directory at the
root, like NARs).
This commit is contained in:
Eelco Dolstra 2024-02-19 13:54:40 +01:00
parent b00f412f81
commit 930b9c8269
2 changed files with 6 additions and 0 deletions

View file

@ -14,6 +14,7 @@ test_fetch_file () {
tree = builtins.fetchTree { type = "file"; url = "file://$PWD/test_input"; };
in
assert (tree.narHash == "$input_hash");
assert builtins.readFile tree == "foo\n";
tree
EOF
}