mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-28 01:07:09 +00:00
Worktree: silence log message when dir is overwritten by file
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
5cbbf620ed
commit
85f8537017
1 changed files with 7 additions and 10 deletions
|
@ -782,7 +782,7 @@ impl BackgroundScanner {
|
||||||
|
|
||||||
let inode = metadata.ino();
|
let inode = metadata.ino();
|
||||||
let is_symlink = fs::symlink_metadata(&path)
|
let is_symlink = fs::symlink_metadata(&path)
|
||||||
.context("symlink_metadata")?
|
.context("failed to read symlink metadata")?
|
||||||
.file_type()
|
.file_type()
|
||||||
.is_symlink();
|
.is_symlink();
|
||||||
let parent = if path == root_path {
|
let parent = if path == root_path {
|
||||||
|
@ -790,7 +790,7 @@ impl BackgroundScanner {
|
||||||
} else {
|
} else {
|
||||||
Some(
|
Some(
|
||||||
fs::metadata(path.parent().unwrap())
|
fs::metadata(path.parent().unwrap())
|
||||||
.context("parent metadata")?
|
.context("failed to read parent inode")?
|
||||||
.ino(),
|
.ino(),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
@ -825,14 +825,11 @@ impl BackgroundScanner {
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => match (err.kind(), err.raw_os_error()) {
|
||||||
dbg!(&err);
|
(io::ErrorKind::NotFound, _) => Ok(None),
|
||||||
if err.kind() == io::ErrorKind::NotFound {
|
(io::ErrorKind::Other, Some(libc::ENOTDIR)) => Ok(None),
|
||||||
Ok(None)
|
_ => Err(anyhow::Error::new(err)),
|
||||||
} else {
|
},
|
||||||
Err(anyhow::Error::new(err)).context("fs::metadata")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue