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-18 08:44:37 +01:00 committed by Julian Stecklina
parent be84049baf
commit b306b7039e

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" });