cc49859b08
- is_git_repo: check out.strip() == "true" (bare repos / .git dirs exit 0 with "false") - _validate_branch: new shared helper calls check-ref-format; used in all three public branch-taking functions to block option-injection (--detach, --all, etc.) - _ensure_worktrees_excluded: prepend newline when existing content lacks trailing newline - WorktreeState: make frozen=True (codebase precedent) - create_worktree invalid-branch ServiceError now includes git stderr - remove_worktree: log.debug for silently-swallowed branch -d / worktree prune failures - worktree_state docstring: document git-failure → clean-state behaviour - Tests: 9 new regression tests; raw subprocess.run commit calls replaced with _commit helper Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>