diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2020-03-18 08:45:31 +0100 |
---|---|---|
committer | Julian Stecklina <js@alien8.de> | 2020-03-29 22:29:58 +0200 |
commit | cc522d0d23b71faeac95998d264abe14ddceeed5 (patch) | |
tree | 525358b762c341cea31b2a9657a5f0221ad49b08 /src | |
parent | b306b7039ef3f2b76dbcc8020dcf67ed27442e7a (diff) |
fetchGit: fix submodules = true for dirty trees
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 0c6bc6dc0..66e1d7b98 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -55,8 +55,12 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, gitInfo.rev = "0000000000000000000000000000000000000000"; gitInfo.shortRev = std::string(gitInfo.rev, 0, 7); + auto gitOpts = Strings({ "-C", uri, "ls-files", "-z" }); + if (fetchSubmodules) { + gitOpts.emplace_back("--recurse-submodules"); + } auto files = tokenizeString<std::set<std::string>>( - runProgram("git", true, { "-C", uri, "ls-files", "-z" }), "\0"s); + runProgram("git", true, gitOpts), "\0"s); PathFilter filter = [&](const Path & p) -> bool { assert(hasPrefix(p, uri)); |