Finish removing git repository state and scanning logic from worktrees (#27568)
This PR completes the process of moving git repository state storage and scanning logic from the worktree crate to `project::git_store`. Release Notes: - N/A --------- Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
8f25251faf
commit
e7290df02b
39 changed files with 3121 additions and 3529 deletions
|
@ -872,21 +872,6 @@ impl BufferStore {
|
|||
cx.background_spawn(async move { task.await.map_err(|e| anyhow!("{e}")) })
|
||||
}
|
||||
|
||||
pub(crate) fn worktree_for_buffer(
|
||||
&self,
|
||||
buffer: &Entity<Buffer>,
|
||||
cx: &App,
|
||||
) -> Option<(Entity<Worktree>, Arc<Path>)> {
|
||||
let file = buffer.read(cx).file()?;
|
||||
let worktree_id = file.worktree_id(cx);
|
||||
let path = file.path().clone();
|
||||
let worktree = self
|
||||
.worktree_store
|
||||
.read(cx)
|
||||
.worktree_for_id(worktree_id, cx)?;
|
||||
Some((worktree, path))
|
||||
}
|
||||
|
||||
pub fn create_buffer(&mut self, cx: &mut Context<Self>) -> Task<Result<Entity<Buffer>>> {
|
||||
match &self.state {
|
||||
BufferStoreState::Local(this) => this.create_buffer(cx),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue