pub fn enumerate_stacks(
repo: &Repository,
model: StackModel,
) -> Result<Vec<Stack>>Expand description
Return all stacks present in metadata, one per connected component.
Each returned Stack corresponds to one potential StackGroup — the same (trunk, sorted diffs) key used by group_by_stack. Used by the list command to surface
stacks that have no checked-out worktrees.
Under StackModel::Mixed, returns the primary provider’s stacks followed by the
secondary’s, excluding any secondary stack that shares a branch with a primary stack — a
branch belongs to one place in the tree, and the primary’s placement always wins (the CLI’s
display::build_tree merges stacks per trunk with a visited-based dedupe that would
otherwise drop the shared branch non-deterministically).