beautiful diff

This commit is contained in:
Conrad Irwin 2023-11-01 15:31:37 -06:00
parent cd10ba9e06
commit 90facc051a
5 changed files with 507 additions and 474 deletions

View file

@ -877,14 +877,17 @@ impl Project {
)
});
for path in root_paths {
dbg!(&path);
let (tree, _) = project
.update(cx, |project, cx| {
project.find_or_create_local_worktree(path, true, cx)
})
.await
.unwrap();
dbg!("aaa");
tree.update(cx, |tree, _| tree.as_local().unwrap().scan_complete())
.await;
dbg!("bbb");
}
project
}
@ -5990,8 +5993,10 @@ impl Project {
) -> Task<Result<(Model<Worktree>, PathBuf)>> {
let abs_path = abs_path.as_ref();
if let Some((tree, relative_path)) = self.find_local_worktree(abs_path, cx) {
dbg!("shortcut");
Task::ready(Ok((tree, relative_path)))
} else {
dbg!("long cut");
let worktree = self.create_local_worktree(abs_path, visible, cx);
cx.background_executor()
.spawn(async move { Ok((worktree.await?, PathBuf::new())) })