fetchGit: checkout rev instead of latest ref

Major bugfix for the submodules = true code path.

TODO: Add tests.
This commit is contained in:
Bjørn Forsman
2020-03-29 22:29:58 +02:00
committed by Julian Stecklina
parent be84049baf
commit b306b7039e
+1 -1
View File
@@ -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" });