Convert weak worktree handles into strong handles when sharing

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-03-02 18:07:32 +01:00 committed by Max Brunsfeld
parent 4b0300daea
commit 07120d47f9
2 changed files with 38 additions and 9 deletions

View file

@ -345,6 +345,10 @@ impl Worktree {
matches!(self, Worktree::Local(_))
}
pub fn is_remote(&self) -> bool {
!self.is_local()
}
pub fn snapshot(&self) -> Snapshot {
match self {
Worktree::Local(worktree) => worktree.snapshot().snapshot,