Milestone 2.1: Overview #4

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

Overview

Implement git_worktree_create tool with proper validation and error handling.

Acceptance Criteria

  • Validates input parameters (path, branch name)
  • Refuses if path already exists: "Path '' already exists. Choose a different location."
  • Refuses if creating on current branch: "Can't create worktree on the current branch — switch first."
  • Uses -b flag when creating new branch
  • Surfaces git errors with helpful suggestions

Implementation Steps

  1. Validate input parameters
  2. Check if path already exists — refuse if so
  3. Determine whether to use -b flag (create new branch) or not
  4. Run git worktree add <path> [branch]
  5. Handle errors with clear messages

Validation

  • Create worktree on new branch — verify it appears in git worktree list
  • Try to create at existing path — should refuse with clear error
  • Try to create on current branch — should refuse with clear error
# Overview Implement `git_worktree_create` tool with proper validation and error handling. ## Acceptance Criteria - [ ] Validates input parameters (path, branch name) - [ ] Refuses if path already exists: "Path '<path>' already exists. Choose a different location." - [ ] Refuses if creating on current branch: "Can't create worktree on the current branch — switch first." - [ ] Uses `-b` flag when creating new branch - [ ] Surfaces git errors with helpful suggestions ## Implementation Steps 1. Validate input parameters 2. Check if path already exists — refuse if so 3. Determine whether to use `-b` flag (create new branch) or not 4. Run `git worktree add <path> [branch]` 5. Handle errors with clear messages ## Validation - Create worktree on new branch — verify it appears in `git worktree list` - Try to create at existing path — should refuse with clear error - Try to create on current branch — should refuse with clear error
david closed this issue 2026-07-24 21:19:01 +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#4
No description provided.