@@ -494,11 +494,12 @@ impl Build {
494494 let submodule_git = || helpers:: git ( Some ( & absolute_path) ) ;
495495
496496 // 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 ) ;
498498 let checked_out_hash = checked_out_hash. trim_end ( ) ;
499499 // 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+ ) ;
502503 let actual_hash = recorded
503504 . split_whitespace ( )
504505 . nth ( 2 )
@@ -521,6 +522,7 @@ impl Build {
521522 let current_branch = {
522523 let output = helpers:: git ( Some ( & self . src ) )
523524 . args ( [ "symbolic-ref" , "--short" , "HEAD" ] )
525+ . command
524526 . stderr ( Stdio :: inherit ( ) )
525527 . output ( ) ;
526528 let output = t ! ( output) ;
@@ -546,7 +548,7 @@ impl Build {
546548 git
547549 } ;
548550 // 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 ( ) ) {
550552 self . run ( update ( false ) ) ;
551553 }
552554
@@ -577,12 +579,15 @@ impl Build {
577579 if !self . config . submodules ( self . rust_info ( ) ) {
578580 return ;
579581 }
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 ( ) ;
586591 for line in output. lines ( ) {
587592 // Look for `submodule.$name.path = $path`
588593 // Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
@@ -950,7 +955,10 @@ impl Build {
950955 command. command . status ( ) . map ( |status| status. into ( ) ) ,
951956 matches ! ( mode, OutputMode :: All ) ,
952957 ) ,
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+ ) ,
954962 } ;
955963
956964 let output = match output {
@@ -1480,14 +1488,18 @@ impl Build {
14801488 // Figure out how many merge commits happened since we branched off master.
14811489 // That's our beta number!
14821490 // (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 ! (
14861498 "refs/remotes/origin/{}..HEAD" ,
14871499 self . config. stage0_metadata. config. nightly_branch
1488- ) ,
1489- ) ,
1500+ ) ) ,
14901501 )
1502+ . stdout ( )
14911503 } ) ;
14921504 let n = count. trim ( ) . parse ( ) . unwrap ( ) ;
14931505 self . prerelease_version . set ( Some ( n) ) ;
@@ -1914,6 +1926,7 @@ fn envify(s: &str) -> String {
19141926pub fn generate_smart_stamp_hash ( dir : & Path , additional_input : & str ) -> String {
19151927 let diff = helpers:: git ( Some ( dir) )
19161928 . arg ( "diff" )
1929+ . command
19171930 . output ( )
19181931 . map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
19191932 . unwrap_or_default ( ) ;
@@ -1923,6 +1936,7 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
19231936 . arg ( "--porcelain" )
19241937 . arg ( "-z" )
19251938 . arg ( "--untracked-files=normal" )
1939+ . command
19261940 . output ( )
19271941 . map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
19281942 . unwrap_or_default ( ) ;
0 commit comments