Conversation
…n pattern
The delete command was trying to delete branches with the pattern
`phantom/worktrees/${name}` but branches are actually created with
just the worktree name. This fix ensures branches are properly
deleted when removing worktrees.
Also improves error handling to report branch deletion failures
instead of silently ignoring them.
Fixes #77
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
…error handling Updated deleteBranch to return Result<boolean, GitOperationError> instead of a custom object, following the established pattern in the codebase for type-safe error handling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Each test has its own mock context, so explicit reset calls are not needed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
tsukimiya
pushed a commit
to tsukimiya/phantom
that referenced
this pull request
Nov 2, 2025
…phantompane#78) * fix: correct branch naming pattern in delete command to match creation pattern The delete command was trying to delete branches with the pattern `phantom/worktrees/${name}` but branches are actually created with just the worktree name. This fix ensures branches are properly deleted when removing worktrees. Also improves error handling to report branch deletion failures instead of silently ignoring them. Fixes phantompane#77 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: use Result<T> type in deleteBranch function for consistent error handling Updated deleteBranch to return Result<boolean, GitOperationError> instead of a custom object, following the established pattern in the codebase for type-safe error handling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: remove unnecessary mock.reset() calls from tests Each test has its own mock context, so explicit reset calls are not needed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phantom deletecommand that prevented branches from being deletedDetails
The delete command was attempting to delete branches with the pattern
phantom/worktrees/${name}, but branches are actually created with just the worktree name (e.g.,featureinstead ofphantom/worktrees/feature).This PR updates the branch deletion logic to use the correct branch name and adds proper error reporting when branch deletion fails.
Test plan
pnpm readyFixes #77
🤖 Generated with Claude Code