feat: implement git_worktree_remove tool (Issue #5) #18
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "issue-5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement
git_worktree_removetool with proper validation and error handling.Changes
pi-worktree-remove.ts— pure validation functions for remove operationvalidateRemoveWorktreeInput()— validates path is non-emptyisMainRepository()— refuses removal of main repo root (suggestsgit worktree prune)hasUncommittedChanges()— checks git status --porcelain outputbuildWorktreeRemoveCommand()— buildsgit worktree removeargs with optional--forcepi-worktree-remove.test.ts— 17 unit tests covering all validation pathscreateRemoveWorktreeTool()in main extension with full validation pipelineTesting
Checklist