Add validation and error handling for removing linked worktrees: - validateRemoveWorktreeInput() — validates path is non-empty - isMainRepository() — refuses removal of main repo root - hasUncommittedChanges() — checks git status --porcelain output - buildWorktreeRemoveCommand() — builds git worktree remove args Wire up createRemoveWorktreeTool with full validation pipeline: 1. Validate input parameters (path) 2. Check if target is the main repo — refuse with prune suggestion 3. Check for uncommitted changes — refuse with stash/commit message 4. Run git worktree remove <path> 5. Surface git errors with helpful suggestions |
||
|---|---|---|
| .. | ||
| pi-worktree-create.ts | ||
| pi-worktree-parser.ts | ||
| pi-worktree-remove.test.ts | ||
| pi-worktree-remove.ts | ||
| pi-worktree.test.ts | ||
| pi-worktree.ts | ||