diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-11-20T19·41+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-11-20T19·41+0100 |
commit | 3f4de91d80da01f5612d839e610b113b8d159065 (patch) | |
tree | 19c585ea568c39eca25bc3f506ade99b6090668e /src/libexpr/primops | |
parent | ebeea068d52abd02adbbfed3a0f7555300d6b048 (diff) | |
parent | 02098d2073e2f7c06b6d05c6749ae2b76b7f57d5 (diff) |
Merge branch 'better-git-cache' of https://github.com/graham-at-target/nix
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 0c6539959bf6..5d6249e565de 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -3,6 +3,7 @@ #include "download.hh" #include "store-api.hh" #include "pathlocks.hh" +#include "hash.hh" #include <sys/time.h> @@ -84,9 +85,10 @@ GitInfo exportGit(ref<Store> store, const std::string & uri, if (rev != "" && !std::regex_match(rev, revRegex)) throw Error("invalid Git revision '%s'", rev); - Path cacheDir = getCacheDir() + "/nix/git"; + Path cacheDir = getCacheDir() + "/nix/gitv2/" + hashString(htSHA256, uri).to_string(Base32, false); if (!pathExists(cacheDir)) { + createDirs(dirOf(cacheDir)); runProgram("git", true, { "init", "--bare", cacheDir }); } |