aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-07-06 21:06:22 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-07-06 21:06:22 +0200
commitcc218b15bad7d1883ac951bc48a8285fcef78916 (patch)
treebb0779a2727c38e2cb05832ac9d9c6ecf5f4638c /src/libexpr/primops
parente5f881a7e49b2c4401fd868e0fcd2503b16a1dc8 (diff)
parentb5ae85f0882f4857f550ed68b23af260af5000a0 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/fetchGit.cc5
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);