Skip to main content

Module worktree

Module worktree 

Source
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 -z reports it.

Enums§

WtClass
What rk worktree prune says 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: None clears the removal, Some(reason) keeps it.