Skip to content

Commit 83ff523

Browse files
committed
parsePathFlakeRefWithFragment(): Handle query params in the non-git case
Backported from lazy-trees.
1 parent 28caa35 commit 83ff523

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/libflake/flake/flakeref.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,13 @@ std::pair<FlakeRef, std::string> parsePathFlakeRefWithFragment(
183183
path = canonPath(path + "/" + getOr(query, "dir", ""));
184184
}
185185

186-
fetchers::Attrs attrs;
187-
attrs.insert_or_assign("type", "path");
188-
attrs.insert_or_assign("path", path);
189-
190-
return std::make_pair(FlakeRef(fetchers::Input::fromAttrs(fetchSettings, std::move(attrs)), ""), fragment);
186+
return fromParsedURL(fetchSettings, {
187+
.scheme = "path",
188+
.authority = "",
189+
.path = path,
190+
.query = query,
191+
.fragment = fragment
192+
}, isFlake);
191193
}
192194

193195
/**

0 commit comments

Comments
 (0)