Skip to main content

get_worktree_status

Function get_worktree_status 

Source
pub fn get_worktree_status(
    path: &Path,
    repo: &Path,
    branch: Option<&str>,
) -> String
Expand description

Determine the status of a worktree.

Status priority: stale > busy > active > merged > pr-open > modified > clean

Merge detection strategy:

  1. gh pr view (primary) — works with all merge strategies (merge commit, squash merge, rebase merge) because GitHub tracks PR state independently of commit SHAs.
  2. git branch --merged (fallback) — only works when commit SHAs are preserved (merge commit strategy). Used when gh is not available.