fetchGit: Don't barf if we can't update our Git clone

Instead print a warning that we're continuing with the most recently
fetched version.
This commit is contained in:
Eelco Dolstra 2019-05-23 23:38:40 +02:00
parent 013f4928c8
commit 6e984431dd

View file

@ -139,7 +139,12 @@ GitInfo exportGit(ref<Store> store, std::string uri,
// FIXME: git stderr messes up our progress indicator, so
// we're using --quiet for now. Should process its stderr.
runProgram("git", true, { "-C", repoDir, "fetch", "--quiet", "--force", "--", uri, fmt("%s:%s", *ref, *ref) });
try {
runProgram("git", true, { "-C", repoDir, "fetch", "--quiet", "--force", "--", uri, fmt("%s:%s", *ref, *ref) });
} catch (Error & e) {
if (!pathExists(localRefFile)) throw;
warn("could not update local clone of Git repository '%s'; continuing with the most recent version", uri);
}
struct timeval times[2];
times[0].tv_sec = now;