Skip to content

Commit 4034597

Browse files
committed
Suppress error output when executing git commands
1 parent e6414dc commit 4034597

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/git.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ fn load_all_stashes(path: &Path) -> Vec<Commit> {
321321
.arg("-z") // use NUL as a delimiter
322322
.current_dir(path)
323323
.stdout(Stdio::piped())
324+
.stderr(Stdio::null())
324325
.spawn()
325326
.unwrap();
326327

@@ -434,6 +435,7 @@ fn load_refs(path: &Path) -> (RefMap, Head) {
434435
.arg("--dereference")
435436
.current_dir(path)
436437
.stdout(Stdio::piped())
438+
.stderr(Stdio::null())
437439
.spawn()
438440
.unwrap();
439441

@@ -494,6 +496,7 @@ fn load_stashes_as_refs(path: &Path) -> RefMap {
494496
.arg(format!("--format={format}"))
495497
.current_dir(path)
496498
.stdout(Stdio::piped())
499+
.stderr(Stdio::null())
497500
.spawn()
498501
.unwrap();
499502

@@ -572,6 +575,7 @@ fn get_current_branch(path: &Path) -> Option<String> {
572575
.arg("--show-current")
573576
.current_dir(path)
574577
.stdout(Stdio::piped())
578+
.stderr(Stdio::null())
575579
.spawn()
576580
.unwrap();
577581

@@ -606,6 +610,7 @@ pub fn get_diff_summary(path: &Path, commit_hash: &CommitHash) -> Vec<FileChange
606610
.arg(&commit_hash.0)
607611
.current_dir(path)
608612
.stdout(Stdio::piped())
613+
.stderr(Stdio::null())
609614
.spawn()
610615
.unwrap();
611616

@@ -650,6 +655,7 @@ pub fn get_initial_commit_additions(path: &Path, commit_hash: &CommitHash) -> Ve
650655
.arg(&commit_hash.0)
651656
.current_dir(path)
652657
.stdout(Stdio::piped())
658+
.stderr(Stdio::null())
653659
.spawn()
654660
.unwrap();
655661

0 commit comments

Comments
 (0)