Fix hangs in new dispatcher

Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-11-01 17:11:42 -07:00
parent 90facc051a
commit 6ee93125d0
11 changed files with 93 additions and 44 deletions

View file

@ -297,15 +297,12 @@ impl Worktree {
// After determining whether the root entry is a file or a directory, populate the
// snapshot's "root name", which will be used for the purpose of fuzzy matching.
let abs_path = path.into();
eprintln!("get root metadata");
let metadata = fs
.metadata(&abs_path)
.await
.context("failed to stat worktree path")?;
eprintln!("got root metadata");
cx.build_model(move |cx: &mut ModelContext<Worktree>| {
let root_name = abs_path
.file_name()
@ -4067,13 +4064,12 @@ impl WorktreeModelHandle for Model<Worktree> {
fs.create_file(&root_path.join(filename), Default::default())
.await
.unwrap();
cx.executor().run_until_parked();
assert!(tree.update(cx, |tree, _| tree.entry_for_path(filename).is_some()));
fs.remove_file(&root_path.join(filename), Default::default())
.await
.unwrap();
cx.executor().run_until_parked();
assert!(tree.update(cx, |tree, _| tree.entry_for_path(filename).is_none()));
cx.update(|cx| tree.read(cx).as_local().unwrap().scan_complete())