Merge pull request #1239 from zed-industries/ignore-scan-child-errors

Don't stop scanning directory if reading one of the children errors
This commit is contained in:
Antonio Scandurra 2022-06-27 08:47:21 +02:00 committed by GitHub
commit 024dfd760c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2152,9 +2152,13 @@ impl BackgroundScanner {
};
let child_name = child_abs_path.file_name().unwrap();
let child_path: Arc<Path> = job.path.join(child_name).into();
let child_metadata = match self.fs.metadata(&child_abs_path).await? {
Some(metadata) => metadata,
None => continue,
let child_metadata = match self.fs.metadata(&child_abs_path).await {
Ok(Some(metadata)) => metadata,
Ok(None) => continue,
Err(err) => {
log::error!("error processing {:?}: {:?}", child_abs_path, err);
continue;
}
};
// If we find a .gitignore, add it to the stack of ignores used to determine which paths are ignored