@@ -522,11 +522,12 @@ impl Build {
522
522
let submodule_git = || helpers:: git ( Some ( & absolute_path) ) ;
523
523
524
524
// 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 ) ;
526
526
let checked_out_hash = checked_out_hash. trim_end ( ) ;
527
527
// 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
+ ) ;
530
531
let actual_hash = recorded
531
532
. split_whitespace ( )
532
533
. nth ( 2 )
@@ -549,6 +550,7 @@ impl Build {
549
550
let current_branch = {
550
551
let output = helpers:: git ( Some ( & self . src ) )
551
552
. args ( [ "symbolic-ref" , "--short" , "HEAD" ] )
553
+ . command
552
554
. stderr ( Stdio :: inherit ( ) )
553
555
. output ( ) ;
554
556
let output = t ! ( output) ;
@@ -574,7 +576,7 @@ impl Build {
574
576
git
575
577
} ;
576
578
// 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 ( ) ) {
578
580
self . run ( update ( false ) ) ;
579
581
}
580
582
@@ -605,12 +607,15 @@ impl Build {
605
607
if !self . config . submodules ( self . rust_info ( ) ) {
606
608
return ;
607
609
}
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 ( ) ;
614
619
for line in output. lines ( ) {
615
620
// Look for `submodule.$name.path = $path`
616
621
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
@@ -978,7 +983,10 @@ impl Build {
978
983
command. command . status ( ) . map ( |status| status. into ( ) ) ,
979
984
matches ! ( mode, OutputMode :: All ) ,
980
985
) ,
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
+ ) ,
982
990
} ;
983
991
984
992
let output = match output {
@@ -1508,14 +1516,18 @@ impl Build {
1508
1516
// Figure out how many merge commits happened since we branched off master.
1509
1517
// That's our beta number!
1510
1518
// (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 ! (
1514
1526
"refs/remotes/origin/{}..HEAD" ,
1515
1527
self . config. stage0_metadata. config. nightly_branch
1516
- ) ,
1517
- ) ,
1528
+ ) ) ,
1518
1529
)
1530
+ . stdout ( )
1519
1531
} ) ;
1520
1532
let n = count. trim ( ) . parse ( ) . unwrap ( ) ;
1521
1533
self . prerelease_version . set ( Some ( n) ) ;
@@ -1935,6 +1947,7 @@ fn envify(s: &str) -> String {
1935
1947
pub fn generate_smart_stamp_hash ( dir : & Path , additional_input : & str ) -> String {
1936
1948
let diff = helpers:: git ( Some ( dir) )
1937
1949
. arg ( "diff" )
1950
+ . command
1938
1951
. output ( )
1939
1952
. map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
1940
1953
. unwrap_or_default ( ) ;
@@ -1944,6 +1957,7 @@ pub fn generate_smart_stamp_hash(dir: &Path, additional_input: &str) -> String {
1944
1957
. arg ( "--porcelain" )
1945
1958
. arg ( "-z" )
1946
1959
. arg ( "--untracked-files=normal" )
1960
+ . command
1947
1961
. output ( )
1948
1962
. map ( |o| String :: from_utf8 ( o. stdout ) . unwrap_or_default ( ) )
1949
1963
. unwrap_or_default ( ) ;
0 commit comments