Ensure worktree is registered/shared synchronously
This commit is contained in:
parent
530f15b46b
commit
53327e2bf0
3 changed files with 61 additions and 42 deletions
|
@ -4664,12 +4664,17 @@ mod tests {
|
|||
}
|
||||
|
||||
log::info!("Host: find/create local worktree {:?}", path);
|
||||
project
|
||||
.update(&mut cx, |project, cx| {
|
||||
project.find_or_create_local_worktree(path, true, cx)
|
||||
})
|
||||
.await
|
||||
.unwrap();
|
||||
let find_or_create_worktree = project.update(&mut cx, |project, cx| {
|
||||
project.find_or_create_local_worktree(path, true, cx)
|
||||
});
|
||||
let find_or_create_worktree = async move {
|
||||
find_or_create_worktree.await.unwrap();
|
||||
};
|
||||
if rng.lock().gen() {
|
||||
cx.background().spawn(find_or_create_worktree).detach();
|
||||
} else {
|
||||
find_or_create_worktree.await;
|
||||
}
|
||||
}
|
||||
10..=80 if !files.lock().is_empty() => {
|
||||
let buffer = if self.buffers.is_empty() || rng.lock().gen() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue