mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
Use isAbsolute()
This commit is contained in:
parent
ff8e2fe84e
commit
ff9d886f3c
7 changed files with 12 additions and 12 deletions
|
@ -178,7 +178,7 @@ std::pair<FlakeRef, std::string> parsePathFlakeRefWithFragment(
|
|||
}
|
||||
|
||||
} else {
|
||||
if (!hasPrefix(path, "/"))
|
||||
if (!isAbsolute(path))
|
||||
throw BadURL("flake reference '%s' is not an absolute path", url);
|
||||
path = canonPath(path + "/" + getOr(query, "dir", ""));
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ std::optional<std::pair<FlakeRef, std::string>> parseURLFlakeRef(
|
|||
auto parsed = parseURL(url);
|
||||
if (baseDir
|
||||
&& (parsed.scheme == "path" || parsed.scheme == "git+file")
|
||||
&& !hasPrefix(parsed.path, "/"))
|
||||
&& !isAbsolute(parsed.path))
|
||||
parsed.path = absPath(parsed.path, *baseDir);
|
||||
return fromParsedURL(fetchSettings, std::move(parsed), isFlake);
|
||||
} catch (BadURL &) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue