diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-07-01 14:57:59 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-07-01 14:57:59 +0200 |
commit | 7d554f295ca0a8947042f367adb4f198730696be (patch) | |
tree | 427ca3acd0f570d6fdf19e546a5e24e1f36c50ee /src/libexpr/flake/flakeref.cc | |
parent | 26cf0c674f543ec86a5ccb7e05a4773559bb8f8a (diff) |
Support building flakes from a shallow Git repo
Fixes #3756.
Diffstat (limited to 'src/libexpr/flake/flakeref.cc')
-rw-r--r-- | src/libexpr/flake/flakeref.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc index 615269218..701546671 100644 --- a/src/libexpr/flake/flakeref.cc +++ b/src/libexpr/flake/flakeref.cc @@ -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); |