Skip to content

Commit 915d8d8

Browse files
committed
use exec_with_output instead of exec_with_streaming
1 parent d0c9143 commit 915d8d8

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

crates/uv-git/src/git.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl GitRepository {
149149
ProcessBuilder::new("git")
150150
.arg("rev-parse")
151151
.cwd(path)
152-
.exec_with_streaming(&mut silent, &mut silent, true)?;
152+
.exec_with_output()?;
153153

154154
Ok(GitRepository {
155155
path: path.to_path_buf(),
@@ -168,7 +168,7 @@ impl GitRepository {
168168
ProcessBuilder::new("git")
169169
.arg("init")
170170
.cwd(path)
171-
.exec_with_streaming(&mut silent, &mut silent, true)?;
171+
.exec_with_output()?;
172172

173173
Ok(GitRepository {
174174
path: path.to_path_buf(),
@@ -181,7 +181,7 @@ impl GitRepository {
181181
.arg("rev-parse")
182182
.arg(refname)
183183
.cwd(&self.path)
184-
.exec_with_streaming(&mut silent, &mut silent, true)?;
184+
.exec_with_output()?;
185185

186186
let mut result = String::from_utf8(result.stdout)?;
187187
result.truncate(result.trim_end().len());
@@ -289,7 +289,7 @@ impl GitDatabase {
289289
.arg("--short")
290290
.arg(revision.as_str())
291291
.cwd(&self.repo.path)
292-
.exec_with_streaming(&mut silent, &mut silent, true)?;
292+
.exec_with_output()?;
293293

294294
let mut result = String::from_utf8(output.stdout)?;
295295
result.truncate(result.trim_end().len());
@@ -369,7 +369,7 @@ impl GitCheckout {
369369
// have a HEAD checked out.
370370
.arg(database.repo.path.simplified_display().to_string())
371371
.arg(into.simplified_display().to_string())
372-
.exec_with_streaming(&mut silent, &mut silent, true)?;
372+
.exec_with_output()?;
373373

374374
let repo = GitRepository::open(into)?;
375375
let checkout = GitCheckout::new(revision, repo);
@@ -412,7 +412,7 @@ impl GitCheckout {
412412
.arg("--hard")
413413
.arg(self.revision.as_str())
414414
.cwd(&self.repo.path)
415-
.exec_with_streaming(&mut silent, &mut silent, true)?;
415+
.exec_with_output()?;
416416

417417
paths::create(ok_file)?;
418418
Ok(())
@@ -426,7 +426,7 @@ impl GitCheckout {
426426
.arg("--recursive")
427427
.arg("--init")
428428
.cwd(&self.repo.path)
429-
.exec_with_streaming(&mut silent, &mut silent, true)
429+
.exec_with_output()
430430
.map(drop)
431431
}
432432
}
@@ -608,13 +608,7 @@ fn fetch_with_cli(
608608
// We capture the output to avoid streaming it to the user's console during clones.
609609
// The required `on...line` callbacks currently do nothing.
610610
// The output appears to be included in error messages by default.
611-
cmd.exec_with_streaming(&mut silent, &mut silent, true)?;
612-
Ok(())
613-
}
614-
615-
/// Callback used with `exec_with_streaming` that silences the output.
616-
#[allow(clippy::unnecessary_wraps)]
617-
fn silent(_: &str) -> Result<()> {
611+
cmd.exec_with_output()?;
618612
Ok(())
619613
}
620614

0 commit comments

Comments
 (0)