Skip to content

Commit f3aeeca

Browse files
committed
In Nix < 2.20 compat mode, keep the 'dir' attr in URLs
1 parent 4f9c962 commit f3aeeca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libflake/flakeref.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "nix/util/url.hh"
44
#include "nix/util/url-parts.hh"
55
#include "nix/fetchers/fetchers.hh"
6+
#include "nix/fetchers/fetch-settings.hh"
67

78
namespace nix {
89

@@ -61,7 +62,8 @@ static std::pair<FlakeRef, std::string>
6162
fromParsedURL(const fetchers::Settings & fetchSettings, ParsedURL && parsedURL, bool isFlake)
6263
{
6364
auto dir = getOr(parsedURL.query, "dir", "");
64-
parsedURL.query.erase("dir");
65+
if (!fetchSettings.nix219Compat)
66+
parsedURL.query.erase("dir");
6567

6668
std::string fragment;
6769
std::swap(fragment, parsedURL.fragment);

0 commit comments

Comments
 (0)