diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-09-21 14:07:16 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-09-21 14:07:16 +0200 |
commit | 60cc975d22c193cd70cc4e8d3fb5643728aec418 (patch) | |
tree | 6052b1bce0362786718ed7e2189baf40f6164d87 /src/libexpr/flake/flakeref.cc | |
parent | 06557299b30f53c6d4a1a2e3068f36d9ef3df904 (diff) |
Set input parent at construction time
Diffstat (limited to 'src/libexpr/flake/flakeref.cc')
-rw-r--r-- | src/libexpr/flake/flakeref.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc index 833e8a776..29128d789 100644 --- a/src/libexpr/flake/flakeref.cc +++ b/src/libexpr/flake/flakeref.cc @@ -172,8 +172,12 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment( auto parsedURL = parseURL(url); std::string fragment; std::swap(fragment, parsedURL.fragment); + + auto input = Input::fromURL(parsedURL); + input.parent = baseDir; + return std::make_pair( - FlakeRef(Input::fromURL(parsedURL), get(parsedURL.query, "dir").value_or("")), + FlakeRef(std::move(input), get(parsedURL.query, "dir").value_or("")), fragment); } } |