pub fn get_worktree_status(
path: &Path,
repo: &Path,
branch: Option<&str>,
pr_cache: &PrCache,
) -> StringExpand description
Determine the status of a worktree.
Status priority: stale > busy > active > merged > pr-open > modified > clean
Merge detection strategy:
- Cached
gh pr list(primary) — works with all merge strategies (merge commit, squash merge, rebase merge) because GitHub tracks PR state independently of commit SHAs. Oneghcall per repo, cached 60 s. git branch --merged(fallback) — only works when commit SHAs are preserved (merge commit strategy). Used whenghis not available.
See pr_cache::PrCache for the batched fetch and TTL details.