Support building flakes from a shallow Git repo

Fixes #3756.
This commit is contained in:
Eelco Dolstra
2020-07-01 14:57:59 +02:00
parent 26cf0c674f
commit 7d554f295c
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -142,6 +142,9 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment(
parsedURL.query.insert_or_assign("dir", subdir);
}
if (pathExists(flakeRoot + "/.git/shallow"))
parsedURL.query.insert_or_assign("shallow", "1");
return std::make_pair(
FlakeRef(Input::fromURL(parsedURL), get(parsedURL.query, "dir").value_or("")),
fragment);