File tree Expand file tree Collapse file tree 3 files changed +2
-47
lines changed Expand file tree Collapse file tree 3 files changed +2
-47
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ fn get_modified_rs_files(build: &Builder<'_>) -> Result<Option<Vec<String>>, Str
93
93
if !verify_rustfmt_version ( build) {
94
94
return Ok ( None ) ;
95
95
}
96
+
96
97
get_git_modified_files ( & build. config . git_config ( ) , Some ( & build. config . src ) , & [ "rs" ] )
97
98
}
98
99
Original file line number Diff line number Diff line change @@ -13,16 +13,14 @@ use std::ffi::{OsStr, OsString};
13
13
use std:: path:: PathBuf ;
14
14
use std:: { env, fs} ;
15
15
16
- use build_helper:: git:: warn_old_master_branch;
17
-
18
- use crate :: Build ;
19
16
#[ cfg( not( feature = "bootstrap-self-test" ) ) ]
20
17
use crate :: builder:: Builder ;
21
18
use crate :: builder:: Kind ;
22
19
#[ cfg( not( feature = "bootstrap-self-test" ) ) ]
23
20
use crate :: core:: build_steps:: tool;
24
21
use crate :: core:: config:: Target ;
25
22
use crate :: utils:: exec:: command;
23
+ use crate :: Build ;
26
24
27
25
pub struct Finder {
28
26
cache : HashMap < OsString , Option < PathBuf > > ,
@@ -382,14 +380,4 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
382
380
if let Some ( ref s) = build. config . ccache {
383
381
cmd_finder. must_have ( s) ;
384
382
}
385
-
386
- // this warning is useless in CI,
387
- // and CI probably won't have the right branches anyway.
388
- if !build_helper:: ci:: CiEnv :: is_ci ( ) {
389
- if let Err ( e) = warn_old_master_branch ( & build. config . git_config ( ) , & build. config . src )
390
- . map_err ( |e| e. to_string ( ) )
391
- {
392
- eprintln ! ( "unable to check if upstream branch is old: {e}" ) ;
393
- }
394
- }
395
383
}
Original file line number Diff line number Diff line change @@ -196,37 +196,3 @@ pub fn get_git_untracked_files(
196
196
. collect ( ) ;
197
197
Ok ( Some ( files) )
198
198
}
199
-
200
- /// Print a warning if the branch returned from `updated_master_branch` is old
201
- ///
202
- /// For certain configurations of git repository, this remote will not be
203
- /// updated when running `git pull`.
204
- ///
205
- /// This can result in formatting thousands of files instead of a dozen,
206
- /// so we should warn the user something is wrong.
207
- pub fn warn_old_master_branch (
208
- config : & GitConfig < ' _ > ,
209
- git_dir : & Path ,
210
- ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
211
- use std:: time:: Duration ;
212
- const WARN_AFTER : Duration = Duration :: from_secs ( 60 * 60 * 24 * 10 ) ;
213
- let updated_master = updated_master_branch ( config, Some ( git_dir) ) ?;
214
- let branch_path = git_dir. join ( ".git/refs/remotes" ) . join ( & updated_master) ;
215
- match std:: fs:: metadata ( branch_path) {
216
- Ok ( meta) => {
217
- if meta. modified ( ) ?. elapsed ( ) ? > WARN_AFTER {
218
- eprintln ! ( "warning: {updated_master} has not been updated in 10 days" ) ;
219
- } else {
220
- return Ok ( ( ) ) ;
221
- }
222
- }
223
- Err ( err) => {
224
- eprintln ! ( "warning: unable to check if {updated_master} is old due to error: {err}" )
225
- }
226
- }
227
- eprintln ! (
228
- "warning: {updated_master} is used to determine if files have been modified\n \
229
- warning: if it is not updated, this may cause files to be needlessly reformatted"
230
- ) ;
231
- Ok ( ( ) )
232
- }
You can’t perform that action at this time.
0 commit comments