From f25791c196e7bcf76aa76e143a679fe731f77513 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 30 Oct 2017 10:05:43 +0100 Subject: [PATCH] builtins.fetchgit: Don't mess up the progress indicator --- src/libexpr/primops/fetchgit.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libexpr/primops/fetchgit.cc b/src/libexpr/primops/fetchgit.cc index adc587702..4c5799bfe 100644 --- a/src/libexpr/primops/fetchgit.cc +++ b/src/libexpr/primops/fetchgit.cc @@ -29,8 +29,6 @@ Path exportGit(ref store, const std::string & uri, runProgram("git", true, { "init", "--bare", cacheDir }); } - //Activity act(*logger, lvlInfo, format("fetching Git repository '%s'") % uri); - std::string localRef = hashString(htSHA256, fmt("%s-%s", uri, ref)).to_string(Base32, false); Path localRefFile = cacheDir + "/refs/heads/" + localRef; @@ -42,7 +40,11 @@ Path exportGit(ref store, const std::string & uri, if (stat(localRefFile.c_str(), &st) != 0 || st.st_mtime < now - settings.tarballTtl) { - runProgram("git", true, { "-C", cacheDir, "fetch", "--force", "--", uri, ref + ":" + localRef }); + Activity act(*logger, lvlTalkative, actUnknown, fmt("fetching Git repository '%s'", uri)); + + // FIXME: git stderr messes up our progress indicator, so + // we're using --quiet for now. Should process its stderr. + runProgram("git", true, { "-C", cacheDir, "fetch", "--quiet", "--force", "--", uri, ref + ":" + localRef }); struct timeval times[2]; times[0].tv_sec = now;