From badc18f098033e1fdd493616ba8d71b2abd00d24 Mon Sep 17 00:00:00 2001 From: kawaemon Date: Sat, 14 Jan 2023 23:36:38 +0900 Subject: [PATCH 1/3] let git to respect cargo's verbosity --- src/cargo/sources/git/utils.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 457c97c5bb0..182f311a3a6 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -1,7 +1,7 @@ //! Utilities for handling git repositories, mainly around //! authentication/cloning. -use crate::core::GitReference; +use crate::core::{GitReference, Verbosity}; use crate::util::errors::CargoResult; use crate::util::{human_readable_bytes, network, Config, IntoUrl, MetricsCounter, Progress}; use anyhow::{anyhow, Context as _}; @@ -933,6 +933,15 @@ fn fetch_with_cli( if tags { cmd.arg("--tags"); } + match config.shell().verbosity() { + Verbosity::Normal => {} + Verbosity::Verbose => { + cmd.arg("--verbose"); + } + Verbosity::Quiet => { + cmd.arg("--quiet"); + } + } cmd.arg("--force") // handle force pushes .arg("--update-head-ok") // see discussion in #2078 .arg(url) From 462d3ab3e324b922c67ffba96e2a31f41ca25bbb Mon Sep 17 00:00:00 2001 From: kawaemon Date: Sat, 14 Jan 2023 23:38:49 +0900 Subject: [PATCH 2/3] stop capturing git's output --- src/cargo/sources/git/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 182f311a3a6..da899ad178a 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -961,7 +961,7 @@ fn fetch_with_cli( config .shell() .verbose(|s| s.status("Running", &cmd.to_string()))?; - cmd.exec_with_output()?; + cmd.exec()?; Ok(()) } From 5bd8ef62e0e7e08c4aefad8df47dcadfb5f46a37 Mon Sep 17 00:00:00 2001 From: kawaemon Date: Sun, 15 Jan 2023 00:18:12 +0900 Subject: [PATCH 3/3] update test snapshot --- tests/testsuite/git.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs index 35152e34822..705069e0a98 100644 --- a/tests/testsuite/git.rs +++ b/tests/testsuite/git.rs @@ -2749,6 +2749,8 @@ fn use_the_cli() { let stderr = "\ [UPDATING] git repository `[..]` [RUNNING] `git fetch [..]` +From [..] + * [new ref] -> origin/HEAD [COMPILING] dep1 [..] [RUNNING] `rustc [..]` [COMPILING] foo [..]