Remove list_worktrees and use relative paths instead (#26546)

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-03-12 16:06:04 +01:00 committed by GitHub
parent 6bf6fcaa51
commit 41eb586ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 150 additions and 132 deletions

View file

@ -1589,6 +1589,11 @@ impl Project {
self.worktree_store.read(cx).visible_worktrees(cx)
}
pub fn worktree_for_root_name(&self, root_name: &str, cx: &App) -> Option<Entity<Worktree>> {
self.visible_worktrees(cx)
.find(|tree| tree.read(cx).root_name() == root_name)
}
pub fn worktree_root_names<'a>(&'a self, cx: &'a App) -> impl Iterator<Item = &'a str> {
self.visible_worktrees(cx)
.map(|tree| tree.read(cx).root_name())