@@ -10,7 +10,7 @@ use crate::core::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun,
1010use crate :: core:: config:: TargetSelection ;
1111use crate :: utils:: channel:: GitInfo ;
1212use crate :: utils:: exec:: { BootstrapCommand , command} ;
13- use crate :: utils:: helpers:: { add_dylib_path, exe, git , t} ;
13+ use crate :: utils:: helpers:: { add_dylib_path, exe, t} ;
1414use crate :: { Compiler , Kind , Mode , gha} ;
1515
1616#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -603,20 +603,11 @@ impl Step for Rustdoc {
603603 )
604604 . unwrap ( ) ;
605605
606- let librustdoc_src = builder. config . src . join ( "src/librustdoc" ) ;
607- let rustdoc_src = builder. config . src . join ( "src/tools/rustdoc" ) ;
608-
609- // FIXME: The change detection logic here is quite similar to `Config::download_ci_rustc_commit`.
610- // It would be better to unify them.
611- let has_changes = !git ( Some ( & builder. config . src ) )
612- . allow_failure ( )
613- . run_always ( )
614- . args ( [ "diff-index" , "--quiet" , & commit] )
615- . arg ( "--" )
616- . arg ( librustdoc_src)
617- . arg ( rustdoc_src)
618- . run ( builder) ;
619-
606+ let dirs = vec ! [
607+ builder. config. src. join( "src/librustdoc" ) ,
608+ builder. config. src. join( "src/tools/rustdoc" ) ,
609+ ] ;
610+ let has_changes = builder. config . check_for_changes ( & dirs, & commit) ;
620611 if !has_changes {
621612 let precompiled_rustdoc = builder
622613 . config
0 commit comments