@@ -10,7 +10,7 @@ use crate::core::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun,
10
10
use crate :: core:: config:: TargetSelection ;
11
11
use crate :: utils:: channel:: GitInfo ;
12
12
use 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} ;
14
14
use crate :: { Compiler , Kind , Mode , gha} ;
15
15
16
16
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
@@ -602,20 +602,11 @@ impl Step for Rustdoc {
602
602
)
603
603
. unwrap ( ) ;
604
604
605
- let librustdoc_src = builder. config . src . join ( "src/librustdoc" ) ;
606
- let rustdoc_src = builder. config . src . join ( "src/tools/rustdoc" ) ;
607
-
608
- // FIXME: The change detection logic here is quite similar to `Config::download_ci_rustc_commit`.
609
- // It would be better to unify them.
610
- let has_changes = !git ( Some ( & builder. config . src ) )
611
- . allow_failure ( )
612
- . run_always ( )
613
- . args ( [ "diff-index" , "--quiet" , & commit] )
614
- . arg ( "--" )
615
- . arg ( librustdoc_src)
616
- . arg ( rustdoc_src)
617
- . run ( builder) ;
618
-
605
+ let dirs = vec ! [
606
+ builder. config. src. join( "src/librustdoc" ) ,
607
+ builder. config. src. join( "src/tools/rustdoc" ) ,
608
+ ] ;
609
+ let has_changes = builder. config . check_for_changes ( & dirs, & commit) ;
619
610
if !has_changes {
620
611
let precompiled_rustdoc = builder
621
612
. config
0 commit comments