mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 02:48:34 +00:00
Avoid unnecessarily emitting fake fs events for dirs that exist
This commit is contained in:
parent
f9df5fe595
commit
11ef6bfbae
1 changed files with 8 additions and 6 deletions
|
@ -554,12 +554,14 @@ impl Fs for FakeFs {
|
|||
state.next_inode += 1;
|
||||
state
|
||||
.write_path(&cur_path, |entry| {
|
||||
entry.or_insert(Arc::new(Mutex::new(FakeFsEntry::Dir {
|
||||
inode,
|
||||
mtime: SystemTime::now(),
|
||||
entries: Default::default(),
|
||||
})));
|
||||
created_dirs.push(cur_path.clone());
|
||||
entry.or_insert_with(|| {
|
||||
created_dirs.push(cur_path.clone());
|
||||
Arc::new(Mutex::new(FakeFsEntry::Dir {
|
||||
inode,
|
||||
mtime: SystemTime::now(),
|
||||
entries: Default::default(),
|
||||
}))
|
||||
});
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
|
|
Loading…
Reference in a new issue