Skip to content

Commit 038d74e

Browse files
committed
Git fetcher: Restore progress indication
We were calling git with `--quiet` in order not to mess up Nix's progress bar. However, `runProgram()` already suspends the progress bar (since git may be interactive) so that's no longer an issue. So we can just run with `--progress` instead.
1 parent b177354 commit 038d74e

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/libfetchers/git-utils.cc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -582,25 +582,15 @@ struct GitRepoImpl : GitRepo, std::enable_shared_from_this<GitRepoImpl>
582582
// then use code that was removed in this commit (see blame)
583583

584584
auto dir = this->path;
585-
Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--quiet", "--force"};
585+
Strings gitArgs{"-C", dir.string(), "--git-dir", ".", "fetch", "--progress", "--force"};
586586
if (shallow)
587587
append(gitArgs, {"--depth", "1"});
588588
append(gitArgs, {std::string("--"), url, refspec});
589589

590-
auto [status, output] = runProgram(
591-
RunOptions{
592-
.program = "git",
593-
.lookupPath = true,
594-
// FIXME: git stderr messes up our progress indicator, so
595-
// we're using --quiet for now. Should process its stderr.
596-
.args = gitArgs,
597-
.input = {},
598-
.mergeStderrToStdout = true,
599-
.isInteractive = true});
590+
auto status = runProgram(RunOptions{.program = "git", .args = gitArgs, .isInteractive = true}).first;
600591

601-
if (status > 0) {
602-
throw Error("Failed to fetch git repository %s : %s", url, output);
603-
}
592+
if (status > 0)
593+
throw Error("Failed to fetch git repository '%s'", url);
604594
}
605595

606596
void verifyCommit(const Hash & rev, const std::vector<fetchers::PublicKey> & publicKeys) override

0 commit comments

Comments
 (0)