@@ -20,7 +20,7 @@ use crate::core::build_steps::llvm;
2020use crate :: core:: config:: flags:: { Color , Flags , Warnings } ;
2121use crate :: utils:: cache:: { Interned , INTERNER } ;
2222use 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} ;
2424use build_helper:: exit;
2525use serde:: { Deserialize , Deserializer } ;
2626use serde_derive:: Deserialize ;
@@ -2471,14 +2471,13 @@ impl Config {
24712471
24722472 // Look for a version to compare to based on the current commit.
24732473 // 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 ( ) ;
24822481 if commit. is_empty ( ) {
24832482 println ! ( "ERROR: could not find commit hash for downloading rustc" ) ;
24842483 println ! ( "HELP: maybe your repository history is too shallow?" ) ;
@@ -2489,7 +2488,7 @@ impl Config {
24892488
24902489 // Warn if there were changes to the compiler or standard library since the ancestor commit.
24912490 let has_changes = !t ! ( helpers:: git( Some ( & self . src) )
2492- . args( [ "diff-index" , "--quiet" , commit] )
2491+ . args( [ "diff-index" , "--quiet" , & commit] )
24932492 . arg( "--" )
24942493 . args( [ self . src. join( "compiler" ) , self . src. join( "library" ) ] )
24952494 . as_command_mut( )
@@ -2565,14 +2564,13 @@ impl Config {
25652564 ) -> Option < String > {
25662565 // Look for a version to compare to based on the current commit.
25672566 // 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 ( ) ;
25762574 if commit. is_empty ( ) {
25772575 println ! ( "error: could not find commit hash for downloading components from CI" ) ;
25782576 println ! ( "help: maybe your repository history is too shallow?" ) ;
@@ -2583,7 +2581,7 @@ impl Config {
25832581
25842582 // Warn if there were changes to the compiler or standard library since the ancestor commit.
25852583 let mut git = helpers:: git ( Some ( & self . src ) ) ;
2586- git. args ( [ "diff-index" , "--quiet" , commit, "--" ] ) ;
2584+ git. args ( [ "diff-index" , "--quiet" , & commit, "--" ] ) ;
25872585
25882586 // Handle running from a directory other than the top level
25892587 let top_level = & self . src ;
0 commit comments