Force orphan worktree cleanup to remove dirty worktrees#73
Force orphan worktree cleanup to remove dirty worktrees#73juliusmarminge merged 1 commit intomainfrom
Conversation
- add optional `force` to remove-worktree contract and server git args - pass `force: true` from sidebar orphaned worktree cleanup flow - add integration test covering dirty worktree removal behavior
|
No actionable comments were generated in the recent review. 🎉 WalkthroughAdds an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Force removal of orphaned git worktrees by passing --force from web to server via
|
Greptile SummaryThis PR adds force removal support for git worktrees to handle the cleanup of dirty worktrees during orphaned worktree deletion.
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Sidebar
participant ReactQuery
participant API
participant GitService
participant Git
User->>Sidebar: Delete thread with orphaned worktree
Sidebar->>ReactQuery: removeWorktreeMutation.mutateAsync({cwd, path, force: true})
ReactQuery->>API: git.removeWorktree({cwd, path, force: true})
API->>GitService: removeWorktree(input)
GitService->>Git: git worktree remove --force {path}
Git-->>GitService: Success (removes dirty worktree)
GitService-->>API: void
API-->>ReactQuery: void
ReactQuery->>ReactQuery: Invalidate git queries
ReactQuery-->>Sidebar: Success
Sidebar-->>User: Worktree removed
Last reviewed commit: 2d3263d |
Summary
forcesupport to git worktree removal in shared contracts and server git execution.force: true.forceflag through the web React Query mutation to the API call.Testing
removeGitWorktree force removes a dirty worktreeinapps/server/src/git.test.ts.Note
Medium Risk
Uses
git worktree remove --force, which can discard uncommitted changes in the worktree; impact is limited to explicit cleanup paths and is covered by an integration test.Overview
Enables optional forced git worktree cleanup by threading a
forceflag through the shared contract, web mutation, and server execution so callers can pass--forcetogit worktree remove.Updates the thread deletion/orphaned worktree cleanup flow in
Sidebarto always attempt removal withforce: true, and adds a server integration test covering the dirty-worktree behavior (non-forced removal fails; forced removal succeeds and deletes the directory).Written by Cursor Bugbot for commit 2d3263d. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
New Features
Tests