Skip to main content

worktrees

Function worktrees 

Source
pub fn worktrees(
    layout: &RepoLayout,
) -> Result<Vec<WorktreeEntry>, DiscoverError>
Expand description

Enumerate the linked-worktree registry of layout’s repository, sorted by id. The main worktree is NOT an entry — its state dir is the common dir itself.

Ids that fail validate_worktree_id and non-directory entries are reported as prunable rather than skipped, so worktree list and worktree prune see the same picture and nothing lingers invisibly.

§Errors

DiscoverError::PointerUnreadable only for an unreadable worktrees/ directory itself; a missing worktrees/ dir yields an empty list.