Milestone 2.2: Overview #5

Closed
opened 2026-07-24 03:22:35 +00:00 by david · 0 comments
Owner

Overview

Implement git_worktree_remove tool with proper validation and error handling.

Acceptance Criteria

  • Validates input parameters (path)
  • Refuses to remove main repo: "Can't remove the main repository. Use 'git worktree prune' instead."
  • Checks for uncommitted changes — refuses if found: "Worktree '' has uncommitted changes. Stash or commit them first?"
  • Runs git worktree remove <path> successfully
  • Surfaces git errors with helpful suggestions

Implementation Steps

  1. Validate input parameters
  2. Check if target is the main repo — refuse if so (suggest git worktree prune)
  3. Check for uncommitted changes — refuse with message if found
  4. Run git worktree remove <path>
  5. Handle errors with clear messages

Validation

  • Remove a worktree with no changes — verify it disappears from git worktree list
  • Try to remove main repo — should refuse with clear error
  • Try to remove worktree with uncommitted changes — should refuse with clear error
# Overview Implement `git_worktree_remove` tool with proper validation and error handling. ## Acceptance Criteria - [ ] Validates input parameters (path) - [ ] Refuses to remove main repo: "Can't remove the main repository. Use 'git worktree prune' instead." - [ ] Checks for uncommitted changes — refuses if found: "Worktree '<path>' has uncommitted changes. Stash or commit them first?" - [ ] Runs `git worktree remove <path>` successfully - [ ] Surfaces git errors with helpful suggestions ## Implementation Steps 1. Validate input parameters 2. Check if target is the main repo — refuse if so (suggest `git worktree prune`) 3. Check for uncommitted changes — refuse with message if found 4. Run `git worktree remove <path>` 5. Handle errors with clear messages ## Validation - Remove a worktree with no changes — verify it disappears from `git worktree list` - Try to remove main repo — should refuse with clear error - Try to remove worktree with uncommitted changes — should refuse with clear error
david closed this issue 2026-07-25 02:21:14 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: david/pi-worktrees#5
No description provided.