mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 06:26:15 +02:00
parent
26cf0c674f
commit
7d554f295c
2 changed files with 5 additions and 0 deletions
|
@ -142,6 +142,9 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment(
|
||||||
parsedURL.query.insert_or_assign("dir", subdir);
|
parsedURL.query.insert_or_assign("dir", subdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pathExists(flakeRoot + "/.git/shallow"))
|
||||||
|
parsedURL.query.insert_or_assign("shallow", "1");
|
||||||
|
|
||||||
return std::make_pair(
|
return std::make_pair(
|
||||||
FlakeRef(Input::fromURL(parsedURL), get(parsedURL.query, "dir").value_or("")),
|
FlakeRef(Input::fromURL(parsedURL), get(parsedURL.query, "dir").value_or("")),
|
||||||
fragment);
|
fragment);
|
||||||
|
|
|
@ -42,6 +42,8 @@ struct GitInputScheme : InputScheme
|
||||||
for (auto &[name, value] : url.query) {
|
for (auto &[name, value] : url.query) {
|
||||||
if (name == "rev" || name == "ref")
|
if (name == "rev" || name == "ref")
|
||||||
attrs.emplace(name, value);
|
attrs.emplace(name, value);
|
||||||
|
else if (name == "shallow")
|
||||||
|
attrs.emplace(name, Explicit<bool> { value == "1" });
|
||||||
else
|
else
|
||||||
url2.query.emplace(name, value);
|
url2.query.emplace(name, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue