mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 19:02:07 +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.next_inode += 1;
|
||||||
state
|
state
|
||||||
.write_path(&cur_path, |entry| {
|
.write_path(&cur_path, |entry| {
|
||||||
entry.or_insert(Arc::new(Mutex::new(FakeFsEntry::Dir {
|
entry.or_insert_with(|| {
|
||||||
inode,
|
created_dirs.push(cur_path.clone());
|
||||||
mtime: SystemTime::now(),
|
Arc::new(Mutex::new(FakeFsEntry::Dir {
|
||||||
entries: Default::default(),
|
inode,
|
||||||
})));
|
mtime: SystemTime::now(),
|
||||||
created_dirs.push(cur_path.clone());
|
entries: Default::default(),
|
||||||
|
}))
|
||||||
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
|
Loading…
Reference in a new issue