1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 13:41:15 +02:00

builtins.fetchgit: Support importing a working tree

For example, you can write

  src = fetchgit ./.;

and if ./. refers to an unclean working tree, that tree will be copied
to the Nix store. This removes the need for "cleanSource".
This commit is contained in:
Eelco Dolstra 2017-10-30 19:57:40 +01:00
parent 197922ea4e
commit 72cd52c3cd
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
7 changed files with 54 additions and 17 deletions

View file

@ -667,7 +667,7 @@ std::pair<bool, std::string> EvalState::resolveSearchPathElem(const SearchPathEl
try {
if (hasPrefix(elem.second, "git://") || hasSuffix(elem.second, ".git"))
// FIXME: support specifying revision/branch
res = { true, exportGit(store, elem.second, "master").storePath };
res = { true, exportGit(store, elem.second).storePath };
else
res = { true, getDownloader()->downloadCached(store, elem.second, true) };
} catch (DownloadError & e) {