aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2020-03-18 08:44:37 +0100
committerJulian Stecklina <js@alien8.de>2020-03-29 22:29:58 +0200
commitb306b7039ef3f2b76dbcc8020dcf67ed27442e7a (patch)
treeb83ab2edf20c3cfb03befab242da9fcfb4c574d4
parentbe84049baf047fd2eee08def5c8013797c0832a0 (diff)
fetchGit: checkout rev instead of latest ref
Major bugfix for the submodules = true code path. TODO: Add tests.
-rw-r--r--src/libexpr/primops/fetchGit.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc
index 969b1a4ed..0c6bc6dc0 100644
--- a/src/libexpr/primops/fetchGit.cc
+++ b/src/libexpr/primops/fetchGit.cc
@@ -182,7 +182,7 @@ GitInfo exportGit(ref<Store> store, const std::string & uri,
runProgram("git", true, { "-C", tmpDir, "fetch", "--quiet", "--force",
"--", cacheDir, fmt("%s", *ref) });
- runProgram("git", true, { "-C", tmpDir, "checkout", "--quiet", "FETCH_HEAD" });
+ runProgram("git", true, { "-C", tmpDir, "checkout", "--quiet", gitInfo.rev });
runProgram("git", true, { "-C", tmpDir, "remote", "add", "origin", uri });
runProgram("git", true, { "-C", tmpDir, "submodule", "--quiet", "update", "--init", "--recursive" });