mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 00:02:25 +00:00
Take the query into account for plain path flakerefs
The query parameters for path flakerefs (`/foo/bar?query=blah` or `.?foo=bar`) was ignored when the path wasn't a git repo. Fix that
This commit is contained in:
parent
f97d6a3178
commit
fbf3f9398a
@ -171,11 +171,16 @@ std::pair<FlakeRef, std::string> parsePathFlakeRefWithFragment(
|
||||
path = canonPath(path + "/" + getOr(query, "dir", ""));
|
||||
}
|
||||
|
||||
fetchers::Attrs attrs;
|
||||
attrs.insert_or_assign("type", "path");
|
||||
attrs.insert_or_assign("path", path);
|
||||
auto parsedURL = ParsedURL{
|
||||
.url = url,
|
||||
.base = url,
|
||||
.scheme = "path",
|
||||
.authority = "",
|
||||
.path = path,
|
||||
.query = query,
|
||||
};
|
||||
|
||||
return std::make_pair(FlakeRef(fetchers::Input::fromAttrs(std::move(attrs)), ""), fragment);
|
||||
return std::make_pair(FlakeRef(fetchers::Input::fromURL(parsedURL), getOr(parsedURL.query, "dir", "")), fragment);
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user