Expand description
Worktree hygiene after squash merges: the pure half.
A linked worktree seats one branch, and the forge’s squash merge
retires that branch the same way it retires a bare one — so the
worktrees need the same post-merge cleanup, resting on the same
merged-request proof. This module holds the pure half of the
rk worktree family: the sibling-path derivation, the fail-closed
parser over git worktree list --porcelain -z, and the guard order
that keeps a worktree out of the candidate set. Spawning stays in the
handler, exactly as crate::branches declares for the branch half.
Structs§
- Layout
- The repository’s layout: the main worktree’s path, its parent, and its basename as the project name the sibling paths compose with.
- Worktree
- One worktree as
git worktree list --porcelain -zreports it.
Enums§
- WtClass
- What
rk worktree prunesays about one linked worktree.
Functions§
- classify
- Classify one worktree for the prune report.
- derived_
path - The canonical worktree path for a branch:
<parent>/<project>-<flat>. - flatten
- The branch name flattened for a directory: every
/becomes-. - matches_
grammar - Whether a branch name matches the landed grammar.
- parse_
worktrees - Parse
git worktree list --porcelain -z. - reobservation
- Judge the last-moment re-observation of one confirmed worktree:
Noneclears the removal,Some(reason)keeps it.