Perform initial file load git diff async

This commit is contained in:
Julia 2022-09-16 14:49:24 -04:00
parent 6825b6077a
commit 6633c0b328
3 changed files with 27 additions and 25 deletions

View file

@ -449,7 +449,11 @@ impl LocalWorktree {
let (file, contents, head_text) = this
.update(&mut cx, |t, cx| t.as_local().unwrap().load(&path, cx))
.await?;
Ok(cx.add_model(|cx| Buffer::from_file(0, contents, head_text, Arc::new(file), cx)))
Ok(cx.add_model(|cx| {
let mut buffer = Buffer::from_file(0, contents, head_text, Arc::new(file), cx);
buffer.update_git(cx);
buffer
}))
})
}