diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-07-06 21:06:22 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-07-06 21:06:22 +0200 |
commit | cc218b15bad7d1883ac951bc48a8285fcef78916 (patch) | |
tree | bb0779a2727c38e2cb05832ac9d9c6ecf5f4638c /src/libexpr/primops/fetchGit.cc | |
parent | e5f881a7e49b2c4401fd868e0fcd2503b16a1dc8 (diff) | |
parent | b5ae85f0882f4857f550ed68b23af260af5000a0 (diff) |
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libexpr/primops/fetchGit.cc')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index f0f5b2a51..10cd2470a 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -112,7 +112,10 @@ GitInfo exportGit(ref<Store> store, std::string uri, runProgram("git", true, { "init", "--bare", repoDir }); } - Path localRefFile = repoDir + "/refs/heads/" + *ref; + Path localRefFile = + ref->compare(0, 5, "refs/") == 0 + ? cacheDir + "/" + *ref + : cacheDir + "/refs/heads/" + *ref; bool doFetch; time_t now = time(0); |