pub struct StaleWorktree {
pub handle: WorktreeHandle,
pub prunable_reason: Option<String>,
}Expand description
A worktree discovered by WorktreeManager::reconcile
that is not present in the current process’s own in-memory session state.
prunable_reason is git’s own verdict from git worktree list --porcelain,
which git derives by checking whether the worktree’s directory and .git
gitdir-link still exist and are valid — not by asking whether this
process happens to recognise the path. This is the only staleness signal
safe to force-remove on: a worktree created by a different, concurrently
running zeph session updates the same on-disk git worktree registry that
reconcile reads, so it is invisible to this process’s self.handles
(documented as session-local, in-RAM-only) yet fully intact on disk, and
git will never mark it prunable while that’s true.
Fields§
§handle: WorktreeHandleThe discovered worktree. branch_name is DETACHED_BRANCH_SENTINEL
for detached-HEAD worktrees and BARE_WORKTREE_SENTINEL for a bare
repository’s main worktree, matching reconcile’s existing behavior.
prunable_reason: Option<String>Some(reason) when git’s own porcelain output includes a prunable
line for this worktree (directory or gitdir-link gone) — None means
the directory is intact and this worktree MUST NOT be force-removed
without an explicit operator override.
Implementations§
Source§impl StaleWorktree
impl StaleWorktree
Sourcepub fn is_safe_to_force_remove(&self) -> bool
pub fn is_safe_to_force_remove(&self) -> bool
True only when git itself has determined this worktree’s directory or
.git link is gone/broken — the one condition under which
force-removal cannot discard live, uncommitted work, regardless of
which process created the worktree.
Trait Implementations§
Source§impl Clone for StaleWorktree
impl Clone for StaleWorktree
Source§fn clone(&self) -> StaleWorktree
fn clone(&self) -> StaleWorktree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more