1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 14:53:16 +02:00

Don't absolutize 'git+file:' in parseURLFlakeRef()

https://github.com/NixOS/nix/issues/12273#issuecomment-2596069519
This commit is contained in:
Eelco Dolstra 2025-01-16 19:04:29 +01:00
parent 40bb5ec675
commit 938f0f4fd9
2 changed files with 1 additions and 2 deletions

View file

@ -233,7 +233,7 @@ std::optional<std::pair<FlakeRef, std::string>> parseURLFlakeRef(
try {
auto parsed = parseURL(url);
if (baseDir
&& (parsed.scheme == "path" || parsed.scheme == "git+file")
&& parsed.scheme == "path"
&& !isAbsolute(parsed.path))
parsed.path = absPath(parsed.path, *baseDir);
return fromParsedURL(fetchSettings, std::move(parsed), isFlake);

View file

@ -224,7 +224,6 @@ nix build -o "$TEST_ROOT/result" "$flake1Dir"
nix build -o "$TEST_ROOT/result" "git+file://$flake1Dir"
(cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" ".")
(cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" "path:.")
(cd "$flake1Dir" && nix build -o "$TEST_ROOT/result" "git+file:.")
# Test explicit packages.default.
nix build -o "$TEST_ROOT/result" "$flake1Dir#default"