@@ -494,11 +494,12 @@ impl Build {
494
494
let submodule_git = || helpers:: git ( Some ( & absolute_path) ) ;
495
495
496
496
// Determine commit checked out in submodule.
497
- let checked_out_hash = output ( submodule_git ( ) . args ( [ "rev-parse" , "HEAD" ] ) ) ;
497
+ let checked_out_hash = output ( & mut submodule_git ( ) . args ( [ "rev-parse" , "HEAD" ] ) . command ) ;
498
498
let checked_out_hash = checked_out_hash. trim_end ( ) ;
499
499
// Determine commit that the submodule *should* have.
500
- let recorded =
501
- output ( helpers:: git ( Some ( & self . src ) ) . args ( [ "ls-tree" , "HEAD" ] ) . arg ( relative_path) ) ;
500
+ let recorded = output (
501
+ & mut helpers:: git ( Some ( & self . src ) ) . args ( [ "ls-tree" , "HEAD" ] ) . arg ( relative_path) . command ,
502
+ ) ;
502
503
let actual_hash = recorded
503
504
. split_whitespace ( )
504
505
. nth ( 2 )
@@ -521,6 +522,7 @@ impl Build {
521
522
let current_branch = {
522
523
let output = helpers:: git ( Some ( & self . src ) )
523
524
. args ( [ "symbolic-ref" , "--short" , "HEAD" ] )
525
+ . command
524
526
. stderr ( Stdio :: inherit ( ) )
525
527
. output ( ) ;
526
528
let output = t ! ( output) ;
@@ -546,7 +548,7 @@ impl Build {
546
548
git
547
549
} ;
548
550
// NOTE: doesn't use `try_run` because this shouldn't print an error if it fails.
549
- if !update ( true ) . status ( ) . map_or ( false , |status| status. success ( ) ) {
551
+ if !update ( true ) . command . status ( ) . map_or ( false , |status| status. success ( ) ) {
550
552
self . run ( update ( false ) ) ;
551
553
}
552
554
@@ -577,12 +579,15 @@ impl Build {
577
579
if !self . config . submodules ( self . rust_info ( ) ) {
578
580
return ;
579
581
}
580
- let output = output (
581
- helpers:: git ( Some ( & self . src ) )
582
- . args ( [ "config" , "--file" ] )
583
- . arg ( self . config . src . join ( ".gitmodules" ) )
584
- . args ( [ "--get-regexp" , "path" ] ) ,
585
- ) ;
582
+ let output = self
583
+ . run (
584
+ helpers:: git ( Some ( & self . src ) )
585
+ . quiet ( )
586
+ . args ( [ "config" , "--file" ] )
587
+ . arg ( self . config . src . join ( ".gitmodules" ) )
588
+ . args ( [ "--get-regexp" , "path" ] ) ,
589
+ )
590
+ . stdout ( ) ;
586
591
for line in output. lines ( ) {
587
592
// Look for `submodule.$name.path = $path`
588
593
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
@@ -950,7 +955,10 @@ impl Build {
950
955
command. command . status ( ) . map ( |status| status. into ( ) ) ,
951
956
matches ! ( mode, OutputMode :: All ) ,
952
957
) ,
953
- OutputMode :: OnlyOnFailure => ( command. command . output ( ) . map ( |o| o. into ( ) ) , true ) ,
958
+ mode @ ( OutputMode :: OnlyOnFailure | OutputMode :: Quiet ) => (
959
+ command. command . output ( ) . map ( |o| o. into ( ) ) ,
960
+ matches ! ( mode, OutputMode :: OnlyOnFailure ) ,
961
+ ) ,
954
962
} ;
955
963
956
964
let output = match output {
@@ -1480,14 +1488,18 @@ impl Build {
1480
1488
// Figure out how many merge commits happened since we branched off master.
1481
1489
// That's our beta number!
1482
1490
// (Note that we use a `..` range, not the `...` symmetric difference.)
1483
- output (
1484
- helpers:: git ( Some ( & self . src ) ) . arg ( "rev-list" ) . arg ( "--count" ) . arg ( "--merges" ) . arg (
1485
- format ! (
1491
+ self . run (
1492
+ helpers:: git ( Some ( & self . src ) )
1493
+ . quiet ( )
1494
+ . arg ( "rev-list" )
1495
+ . arg ( "--count" )
1496
+ . arg ( "--merges" )
1497
+ . arg ( format ! (
1486
1498
"refs/remotes/origin/{}..HEAD" ,
1487
1499
self . config. stage0_metadata. config. nightly_branch
1488
- ) ,
1489
- ) ,
1500
+ ) ) ,
1490
1501
)
1502
+ . stdout ( )
1491
1503
} ) ;
1492
1504
let n = count. trim ( ) . parse ( ) . unwrap ( ) ;
1493
1505
self . prerelease_version . set ( Some ( n) ) ;
@@ -1914,6 +1926,7 @@ fn envify(s: &str) -> String {
1914
1926
pub fn generate_smart_stamp_hash ( dir : & Path , additional_input : & str ) -> String {
1915
1927
let diff = helpers:: git ( Some ( dir) )
1916
1928
. arg ( "diff" )
1929
+ . command
1917
1930
. output ( )
1918
1931
. map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
1919
1932
. unwrap_or_default ( ) ;
@@ -1923,6 +1936,7 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
1923
1936
. arg ( "--porcelain" )
1924
1937
. arg ( "-z" )
1925
1938
. arg ( "--untracked-files=normal" )
1939
+ . command
1926
1940
. output ( )
1927
1941
. map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
1928
1942
. unwrap_or_default ( ) ;
0 commit comments