@@ -20,7 +20,7 @@ use crate::core::build_steps::llvm;
20
20
use crate :: core:: config:: flags:: { Color , Flags , Warnings } ;
21
21
use crate :: utils:: cache:: { Interned , INTERNER } ;
22
22
use crate :: utils:: channel:: { self , GitInfo } ;
23
- use crate :: utils:: helpers:: { self , exe, output, t} ;
23
+ use crate :: utils:: helpers:: { self , exe, get_closest_merge_base_commit , output, t} ;
24
24
use build_helper:: exit;
25
25
use serde:: { Deserialize , Deserializer } ;
26
26
use serde_derive:: Deserialize ;
@@ -2471,14 +2471,13 @@ impl Config {
2471
2471
2472
2472
// Look for a version to compare to based on the current commit.
2473
2473
// Only commits merged by bors will have CI artifacts.
2474
- let merge_base = output (
2475
- helpers:: git ( Some ( & self . src ) )
2476
- . arg ( "rev-list" )
2477
- . arg ( format ! ( "--author={}" , self . stage0_metadata. config. git_merge_commit_email) )
2478
- . args ( [ "-n1" , "--first-parent" , "HEAD" ] )
2479
- . as_command_mut ( ) ,
2480
- ) ;
2481
- let commit = merge_base. trim_end ( ) ;
2474
+ let commit = get_closest_merge_base_commit (
2475
+ Some ( & self . src ) ,
2476
+ & self . git_config ( ) ,
2477
+ & self . stage0_metadata . config . git_merge_commit_email ,
2478
+ & [ ] ,
2479
+ )
2480
+ . unwrap ( ) ;
2482
2481
if commit. is_empty ( ) {
2483
2482
println ! ( "ERROR: could not find commit hash for downloading rustc" ) ;
2484
2483
println ! ( "HELP: maybe your repository history is too shallow?" ) ;
@@ -2489,7 +2488,7 @@ impl Config {
2489
2488
2490
2489
// Warn if there were changes to the compiler or standard library since the ancestor commit.
2491
2490
let has_changes = !t ! ( helpers:: git( Some ( & self . src) )
2492
- . args( [ "diff-index" , "--quiet" , commit] )
2491
+ . args( [ "diff-index" , "--quiet" , & commit] )
2493
2492
. arg( "--" )
2494
2493
. args( [ self . src. join( "compiler" ) , self . src. join( "library" ) ] )
2495
2494
. as_command_mut( )
@@ -2565,14 +2564,13 @@ impl Config {
2565
2564
) -> Option < String > {
2566
2565
// Look for a version to compare to based on the current commit.
2567
2566
// Only commits merged by bors will have CI artifacts.
2568
- let merge_base = output (
2569
- helpers:: git ( Some ( & self . src ) )
2570
- . arg ( "rev-list" )
2571
- . arg ( format ! ( "--author={}" , self . stage0_metadata. config. git_merge_commit_email) )
2572
- . args ( [ "-n1" , "--first-parent" , "HEAD" ] )
2573
- . as_command_mut ( ) ,
2574
- ) ;
2575
- let commit = merge_base. trim_end ( ) ;
2567
+ let commit = get_closest_merge_base_commit (
2568
+ Some ( & self . src ) ,
2569
+ & self . git_config ( ) ,
2570
+ & self . stage0_metadata . config . git_merge_commit_email ,
2571
+ & [ ] ,
2572
+ )
2573
+ . unwrap ( ) ;
2576
2574
if commit. is_empty ( ) {
2577
2575
println ! ( "error: could not find commit hash for downloading components from CI" ) ;
2578
2576
println ! ( "help: maybe your repository history is too shallow?" ) ;
@@ -2583,7 +2581,7 @@ impl Config {
2583
2581
2584
2582
// Warn if there were changes to the compiler or standard library since the ancestor commit.
2585
2583
let mut git = helpers:: git ( Some ( & self . src ) ) ;
2586
- git. args ( [ "diff-index" , "--quiet" , commit, "--" ] ) ;
2584
+ git. args ( [ "diff-index" , "--quiet" , & commit, "--" ] ) ;
2587
2585
2588
2586
// Handle running from a directory other than the top level
2589
2587
let top_level = & self . src ;
0 commit comments