Rollup merge of #110664 - Ezrashaw:fix-bootstrap-build-format, r=jyn514

stop `x fmt` formatting untracked directories

I don't think there's anything else to do? I've confirmed that you get a "skip untracked path foo/ during rustfmt invocations" for the alternative build directory.

r? `@jyn514`
This commit is contained in:
Matthias Krüger 2023-04-23 20:06:31 +02:00 committed by GitHub
commit a557ed0c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,10 +145,8 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
let untracked_paths = untracked_paths_output
.lines()
.filter(|entry| entry.starts_with("??"))
.filter_map(|entry| {
let path =
entry.split(' ').nth(1).expect("every git status entry should list a path");
path.ends_with(".rs").then_some(path)
.map(|entry| {
entry.split(' ').nth(1).expect("every git status entry should list a path")
});
for untracked_path in untracked_paths {
println!("skip untracked path {} during rustfmt invocations", untracked_path);