@@ -522,11 +522,12 @@ impl Build {
522522 let submodule_git = || helpers:: git ( Some ( & absolute_path) ) ;
523523
524524 // Determine commit checked out in submodule.
525- let checked_out_hash = output ( submodule_git ( ) . args ( [ "rev-parse" , "HEAD" ] ) ) ;
525+ let checked_out_hash = output ( & mut submodule_git ( ) . args ( [ "rev-parse" , "HEAD" ] ) . command ) ;
526526 let checked_out_hash = checked_out_hash. trim_end ( ) ;
527527 // Determine commit that the submodule *should* have.
528- let recorded =
529- output ( helpers:: git ( Some ( & self . src ) ) . args ( [ "ls-tree" , "HEAD" ] ) . arg ( relative_path) ) ;
528+ let recorded = output (
529+ & mut helpers:: git ( Some ( & self . src ) ) . args ( [ "ls-tree" , "HEAD" ] ) . arg ( relative_path) . command ,
530+ ) ;
530531 let actual_hash = recorded
531532 . split_whitespace ( )
532533 . nth ( 2 )
@@ -549,6 +550,7 @@ impl Build {
549550 let current_branch = {
550551 let output = helpers:: git ( Some ( & self . src ) )
551552 . args ( [ "symbolic-ref" , "--short" , "HEAD" ] )
553+ . command
552554 . stderr ( Stdio :: inherit ( ) )
553555 . output ( ) ;
554556 let output = t ! ( output) ;
@@ -574,7 +576,7 @@ impl Build {
574576 git
575577 } ;
576578 // NOTE: doesn't use `try_run` because this shouldn't print an error if it fails.
577- if !update ( true ) . status ( ) . map_or ( false , |status| status. success ( ) ) {
579+ if !update ( true ) . command . status ( ) . map_or ( false , |status| status. success ( ) ) {
578580 self . run ( update ( false ) ) ;
579581 }
580582
@@ -605,12 +607,15 @@ impl Build {
605607 if !self . config . submodules ( self . rust_info ( ) ) {
606608 return ;
607609 }
608- let output = output (
609- helpers:: git ( Some ( & self . src ) )
610- . args ( [ "config" , "--file" ] )
611- . arg ( self . config . src . join ( ".gitmodules" ) )
612- . args ( [ "--get-regexp" , "path" ] ) ,
613- ) ;
610+ let output = self
611+ . run (
612+ helpers:: git ( Some ( & self . src ) )
613+ . quiet ( )
614+ . args ( [ "config" , "--file" ] )
615+ . arg ( self . config . src . join ( ".gitmodules" ) )
616+ . args ( [ "--get-regexp" , "path" ] ) ,
617+ )
618+ . stdout ( ) ;
614619 for line in output. lines ( ) {
615620 // Look for `submodule.$name.path = $path`
616621 // Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
@@ -978,7 +983,10 @@ impl Build {
978983 command. command . status ( ) . map ( |status| status. into ( ) ) ,
979984 matches ! ( mode, OutputMode :: All ) ,
980985 ) ,
981- OutputMode :: OnlyOnFailure => ( command. command . output ( ) . map ( |o| o. into ( ) ) , true ) ,
986+ mode @ ( OutputMode :: OnlyOnFailure | OutputMode :: Quiet ) => (
987+ command. command . output ( ) . map ( |o| o. into ( ) ) ,
988+ matches ! ( mode, OutputMode :: OnlyOnFailure ) ,
989+ ) ,
982990 } ;
983991
984992 let output = match output {
@@ -1508,14 +1516,18 @@ impl Build {
15081516 // Figure out how many merge commits happened since we branched off master.
15091517 // That's our beta number!
15101518 // (Note that we use a `..` range, not the `...` symmetric difference.)
1511- output (
1512- helpers:: git ( Some ( & self . src ) ) . arg ( "rev-list" ) . arg ( "--count" ) . arg ( "--merges" ) . arg (
1513- format ! (
1519+ self . run (
1520+ helpers:: git ( Some ( & self . src ) )
1521+ . quiet ( )
1522+ . arg ( "rev-list" )
1523+ . arg ( "--count" )
1524+ . arg ( "--merges" )
1525+ . arg ( format ! (
15141526 "refs/remotes/origin/{}..HEAD" ,
15151527 self . config. stage0_metadata. config. nightly_branch
1516- ) ,
1517- ) ,
1528+ ) ) ,
15181529 )
1530+ . stdout ( )
15191531 } ) ;
15201532 let n = count. trim ( ) . parse ( ) . unwrap ( ) ;
15211533 self . prerelease_version . set ( Some ( n) ) ;
@@ -1935,6 +1947,7 @@ fn envify(s: &str) -> String {
19351947pub fn generate_smart_stamp_hash ( dir : & Path , additional_input : & str ) -> String {
19361948 let diff = helpers:: git ( Some ( dir) )
19371949 . arg ( "diff" )
1950+ . command
19381951 . output ( )
19391952 . map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
19401953 . unwrap_or_default ( ) ;
@@ -1944,6 +1957,7 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
19441957 . arg ( "--porcelain" )
19451958 . arg ( "-z" )
19461959 . arg ( "--untracked-files=normal" )
1960+ . command
19471961 . output ( )
19481962 . map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
19491963 . unwrap_or_default ( ) ;
0 commit comments