Skip to content

Conversation

satococoa
Copy link
Owner

@satococoa satococoa commented Oct 18, 2025

Summary

  • block wtp remove from deleting the worktree that contains the current directory
  • add an explicit error explaining how to switch worktrees before retrying the removal
  • extend unit coverage for the new guard and supporting error helper

Testing

  • go test ./... (fails: permission-based fixtures expect write failures when not running as root)

https://chatgpt.com/codex/tasks/task_e_68f390c09fa88327957ca9a1b618abec

Summary by CodeRabbit

  • Bug Fixes
    • Prevents accidental removal of the currently active worktree by validating paths and returning a clear error that instructs users to switch worktrees before removal.
  • Tests
    • Adds tests ensuring removal fails when targeting the active worktree (including nested paths) and that the error message includes guidance to change worktrees.
  • Errors
    • Adds a dedicated, user-facing error explaining why removal is blocked and how to proceed.
  • Refactor
    • Centralizes worktree-management checks to a shared implementation for consistent behavior.

@Copilot Copilot AI review requested due to automatic review settings October 18, 2025 13:56
@coderabbitai
Copy link

coderabbitai bot commented Oct 18, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds centralized worktree-managed detection and runtime path guards to the remove flow: resolve absolute target and cwd, ensure the target is not the current worktree (or a nested path), return a new CannotRemoveCurrentWorktree error when appropriate, and add tests for that behavior.

Changes

Cohort / File(s) Summary
Worktree management helper
cmd/wtp/worktree_managed.go
Introduces isWorktreeManagedCommon(worktreePath, cfg, mainRepoPath, isMain) to centralize logic for determining whether a worktree is managed.
Remove command and safety checks
cmd/wtp/remove.go
Updates removeCommandWithCommandExecutor to accept cwd string; computes absolute paths, adds isPathWithin checks to prevent removing the active worktree, and returns specific errors (WorktreeRemovalFailed, DirectoryAccessFailed, CannotRemoveCurrentWorktree) on failures.
Path helper(s)
cmd/wtp/...
Adds isPathWithin(basePath, targetPath string) bool helper(s) used for containment checks.
Other commands delegated to common helper
cmd/wtp/cd.go, cmd/wtp/list.go
Replaces inlined worktree-management/path logic with calls to isWorktreeManagedCommon.
Errors and tests
internal/errors/errors.go, internal/errors/errors_test.go
Adds CannotRemoveCurrentWorktree(worktreeName, path string) error and a test TestCannotRemoveCurrentWorktree verifying message contents.
Remove command tests
cmd/wtp/remove_test.go
Adds TestRemoveCommand_FailsWhenRemovingCurrentWorktree asserting removal fails when target equals or is nested under current working directory and that only the worktree-list command runs.
Module file
go.mod
Manifest file included in diff (no logic changes described).

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant RemoveCmd as Remove Command
    participant PathChecker as Path Validator
    participant Executor as Command Executor

    User->>RemoveCmd: request remove <targetPath> (cwd provided)
    RemoveCmd->>RemoveCmd: resolve absTargetPath, resolve absCwd
    RemoveCmd->>PathChecker: isPathWithin(absCwd, absTargetPath)?
    alt target is equal or nested inside cwd
        PathChecker-->>RemoveCmd: true
        RemoveCmd->>User: return CannotRemoveCurrentWorktree error
    else target is outside cwd
        PathChecker-->>RemoveCmd: false
        RemoveCmd->>Executor: run git worktree remove / shell removal
        Executor-->>User: command result (success/failure)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

Possibly related PRs

Poem

🐰
I nibble paths both near and far,
I check the burrow before I spar.
If here I sit, I will not pry —
Hop out first, then say goodbye.
— the rabbit, tidy and wry 🌿

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.36% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "fix: prevent removing current worktree" is directly aligned with the primary objective stated in the PR: blocking wtp remove from deleting the worktree containing the current directory. The changes in cmd/wtp/remove.go implement path guards that validate the target is not the current worktree and return CannotRemoveCurrentWorktree when appropriate. While the PR also includes supporting refactoring (extracting common logic into isWorktreeManagedCommon in cd.go and list.go), the title correctly identifies the core fix rather than the refactoring work. The title is concise, specific, and would allow a reviewer scanning history to immediately understand the primary purpose of the changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/design-wtp-remove-behavior-for-current-wotktree

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b6f91c and 3c016d7.

📒 Files selected for processing (5)
  • cmd/wtp/cd.go (1 hunks)
  • cmd/wtp/list.go (1 hunks)
  • cmd/wtp/remove.go (4 hunks)
  • cmd/wtp/remove_test.go (2 hunks)
  • cmd/wtp/worktree_managed.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmd/wtp/remove_test.go
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run gofmt and goimports; keep imports grouped and organized; local import prefix follows module path github.com/satococoa/wtp
Adhere to golangci-lint rules configured for the project (vet, staticcheck, gosec, mnd, lll=120, etc.)
Errors should be wrapped with context and must not be ignored
Use snake_case for Go filenames; document exported identifiers when non-trivial

Files:

  • cmd/wtp/list.go
  • cmd/wtp/worktree_managed.go
  • cmd/wtp/cd.go
  • cmd/wtp/remove.go
cmd/wtp/**

📄 CodeRabbit inference engine (AGENTS.md)

cmd/wtp/**: CLI entrypoint and commands are implemented under cmd/wtp
Update CLI help text to reflect user-facing changes
Command behavior: wtp cd prints only the absolute worktree path with no side effects
Command behavior: wtp completion generates pure completion scripts via urfave/cli
Command behavior: wtp hook emits shell functions that intercept wtp cd; wtp shell-init combines completion and hook output

Files:

  • cmd/wtp/list.go
  • cmd/wtp/worktree_managed.go
  • cmd/wtp/cd.go
  • cmd/wtp/remove.go
🧠 Learnings (2)
📚 Learning: 2025-10-07T15:56:11.510Z
Learnt from: CR
PR: satococoa/wtp#0
File: AGENTS.md:0-0
Timestamp: 2025-10-07T15:56:11.510Z
Learning: Applies to cmd/wtp/completion.go : Use getWorktreeNameFromPath() to resolve worktree display names consistently across completion, errors, and parsing

Applied to files:

  • cmd/wtp/list.go
  • cmd/wtp/worktree_managed.go
  • cmd/wtp/cd.go
📚 Learning: 2025-10-07T15:56:11.510Z
Learnt from: CR
PR: satococoa/wtp#0
File: AGENTS.md:0-0
Timestamp: 2025-10-07T15:56:11.510Z
Learning: Applies to cmd/wtp/** : Command behavior: wtp cd prints only the absolute worktree path with no side effects

Applied to files:

  • cmd/wtp/cd.go
🧬 Code graph analysis (2)
cmd/wtp/worktree_managed.go (1)
internal/config/config.go (3)
  • Config (12-16)
  • Defaults (19-21)
  • DefaultBaseDir (41-41)
cmd/wtp/remove.go (1)
internal/errors/errors.go (3)
  • WorktreeRemovalFailed (133-166)
  • DirectoryAccessFailed (240-264)
  • CannotRemoveCurrentWorktree (168-173)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: E2E Tests (macos-latest)
🔇 Additional comments (7)
cmd/wtp/worktree_managed.go (1)

10-53: LGTM! Well-structured centralized worktree management logic.

The helper correctly determines if a worktree is managed by checking:

  • Main worktrees are always managed
  • Falls back to default config when none provided
  • Resolves absolute paths for reliable comparison
  • Uses relative path computation to verify containment within baseDir

This consolidation eliminates duplicate logic across cd, list, and remove commands.

cmd/wtp/remove.go (4)

25-27: LGTM! Proper delegation to centralized helper.

The function now correctly delegates to isWorktreeManagedCommon, consolidating the management logic.


94-101: LGTM! Enhanced signature enables path safety checks.

The addition of the cwd parameter enables the function to validate that the target worktree is not the current working directory before proceeding with removal.


168-183: LGTM! Correct path containment implementation.

The isPathWithin helper correctly determines if targetPath is within basePath using relative path computation:

  • Returns true when paths are equal ("." or "")
  • Returns false when target is outside base (".." prefix)
  • Returns true for nested paths within base

118-130: Review comment is incorrect about filtering preventing the safety check.

The review comment claims test worktrees are filtered as unmanaged by isWorktreeManaged at line 239, preventing the path safety check from running. However, tracing through the logic:

  1. isWorktreeManagedCommon checks if a worktree path is within baseDir
  2. With default BaseDir="../worktrees" and mainWorktreePath="/repo", the resolved baseDir is /worktrees
  3. Test worktree at /worktrees/feature/foo is within /worktrees, so relPath="feature/foo" passes the check (not starting with "..")
  4. isWorktreeManaged returns true, so the worktree is not filtered out
  5. Execution reaches the path safety check at lines 118-130, which correctly returns CannotRemoveCurrentWorktree

The test should work as written. If test failures actually occur, they're not caused by the filtering logic mentioned in the review.

Likely an incorrect or invalid review comment.

cmd/wtp/cd.go (1)

22-24: LGTM! Clean delegation to centralized helper.

The refactor properly replaces inlined worktree management logic with the shared isWorktreeManagedCommon helper, maintaining existing behavior while improving maintainability.

cmd/wtp/list.go (1)

164-166: LGTM! Clean delegation to centralized helper.

The refactor properly replaces inlined worktree management logic with the shared isWorktreeManagedCommon helper, maintaining existing behavior while improving maintainability.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds safety checks to prevent users from accidentally removing the worktree that contains their current working directory. It introduces validation logic that detects when the target worktree path contains the current directory and provides helpful error messaging with guidance on how to switch worktrees before retrying the removal.

  • Adds isPathWithin helper function to detect if current directory is within the target worktree
  • Creates CannotRemoveCurrentWorktree error function with user-friendly guidance
  • Extends test coverage for the new validation logic and error handling

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
cmd/wtp/remove.go Adds current directory validation logic and path comparison helper
internal/errors/errors.go Introduces new error function for current worktree removal attempts
internal/errors/errors_test.go Adds unit test for the new error function
cmd/wtp/remove_test.go Adds comprehensive test coverage for current worktree removal prevention

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return errors.DirectoryAccessFailed("access current", cwd, err)
}

if isPathWithin(absTargetPath, absCwd) {
Copy link

Copilot AI Oct 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function call arguments are reversed. Based on the function logic, isPathWithin(basePath, targetPath) should be called as isPathWithin(absCwd, absTargetPath) to check if the current working directory is within the target worktree path.

Suggested change
if isPathWithin(absTargetPath, absCwd) {
if isPathWithin(absCwd, absTargetPath) {

Copilot uses AI. Check for mistakes.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 780af9d and 0e23691.

📒 Files selected for processing (4)
  • cmd/wtp/remove.go (3 hunks)
  • cmd/wtp/remove_test.go (2 hunks)
  • internal/errors/errors.go (1 hunks)
  • internal/errors/errors_test.go (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run gofmt and goimports; keep imports grouped and organized; local import prefix follows module path github.com/satococoa/wtp
Adhere to golangci-lint rules configured for the project (vet, staticcheck, gosec, mnd, lll=120, etc.)
Errors should be wrapped with context and must not be ignored
Use snake_case for Go filenames; document exported identifiers when non-trivial

Files:

  • internal/errors/errors.go
  • cmd/wtp/remove_test.go
  • internal/errors/errors_test.go
  • cmd/wtp/remove.go
internal/{git,config,hooks,command,errors,io}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place internal packages within internal/{git,config,hooks,command,errors,io}

Files:

  • internal/errors/errors.go
  • internal/errors/errors_test.go
cmd/wtp/**

📄 CodeRabbit inference engine (AGENTS.md)

cmd/wtp/**: CLI entrypoint and commands are implemented under cmd/wtp
Update CLI help text to reflect user-facing changes
Command behavior: wtp cd prints only the absolute worktree path with no side effects
Command behavior: wtp completion generates pure completion scripts via urfave/cli
Command behavior: wtp hook emits shell functions that intercept wtp cd; wtp shell-init combines completion and hook output

Files:

  • cmd/wtp/remove_test.go
  • cmd/wtp/remove.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*_test.go: Unit tests live alongside packages and use *_test.go naming
Prefer table-driven tests and mock git operations in unit tests

Files:

  • cmd/wtp/remove_test.go
  • internal/errors/errors_test.go
🧠 Learnings (2)
📚 Learning: 2025-10-07T15:56:11.510Z
Learnt from: CR
PR: satococoa/wtp#0
File: AGENTS.md:0-0
Timestamp: 2025-10-07T15:56:11.510Z
Learning: Applies to cmd/wtp/completion.go : Use getWorktreeNameFromPath() to resolve worktree display names consistently across completion, errors, and parsing

Applied to files:

  • cmd/wtp/remove.go
📚 Learning: 2025-10-07T15:56:11.510Z
Learnt from: CR
PR: satococoa/wtp#0
File: AGENTS.md:0-0
Timestamp: 2025-10-07T15:56:11.510Z
Learning: Applies to cmd/wtp/** : Command behavior: wtp cd prints only the absolute worktree path with no side effects

Applied to files:

  • cmd/wtp/remove.go
🧬 Code graph analysis (3)
cmd/wtp/remove_test.go (1)
internal/command/types.go (2)
  • Result (11-15)
  • Command (4-8)
internal/errors/errors_test.go (1)
internal/errors/errors.go (1)
  • CannotRemoveCurrentWorktree (168-173)
cmd/wtp/remove.go (1)
internal/errors/errors.go (3)
  • WorktreeRemovalFailed (133-166)
  • DirectoryAccessFailed (240-264)
  • CannotRemoveCurrentWorktree (168-173)
🪛 GitHub Actions: CI
cmd/wtp/remove_test.go

[error] 432-432: Command failed: go test -race -coverprofile=coverage.out -covermode=atomic ./...; Test failure in TestRemoveCommand_FailsWhenRemovingCurrentWorktree/exact_worktree_path: expected error to contain "cannot remove worktree 'feature/foo'" but got "worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees"


[error] 432-432: Command failed: go test -race -coverprofile=coverage.out -covermode=atomic ./...; Test failure in TestRemoveCommand_FailsWhenRemovingCurrentWorktree/nested_directory_inside_worktree: expected error to contain "cannot remove worktree 'feature/foo'" but got "worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees"

🪛 GitHub Actions: E2E Tests
cmd/wtp/remove_test.go

[error] 432-432: TestRemoveCommand_FailsWhenRemovingCurrentWorktree (exact_worktree_path) failed: expected error message to contain "cannot remove worktree 'feature/foo'" but got: "worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees"


[error] 432-432: TestRemoveCommand_FailsWhenRemovingCurrentWorktree (nested_directory_inside_worktree) failed: expected error message to contain "cannot remove worktree 'feature/foo'" but got: "worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees"

🔇 Additional comments (6)
internal/errors/errors_test.go (1)

214-221: LGTM!

The test structure follows the established patterns in the file and appropriately validates that the error message includes all critical information: the worktree name, current location, and helpful guidance.

internal/errors/errors.go (1)

168-173: LGTM!

The error message is clear, informative, and provides actionable guidance. The tip includes specific commands (wtp cd @ and wtp cd <another-worktree>) that help users resolve the issue immediately.

cmd/wtp/remove_test.go (1)

6-6: LGTM!

The fmt import is correctly added to support the test's use of fmt.Sprintf for constructing mock worktree list output.

cmd/wtp/remove.go (3)

136-136: LGTM!

The parameter name cwd clearly indicates it represents the current working directory, making the function signature more self-documenting.


156-168: LGTM!

The path validation logic correctly prevents removing the current worktree by:

  1. Computing absolute paths for both the target worktree and current directory
  2. Checking if the current directory is within the target worktree path
  3. Returning an appropriate error with helpful guidance

This covers both exact path matches and nested directories within the worktree.


206-221: LGTM!

The isPathWithin helper correctly determines path containment using filepath.Rel:

  • Returns true when targetPath equals or is within basePath
  • Returns false when targetPath is outside basePath (relative path starts with ..)
  • Safely returns false on errors

The logic properly handles the use case where we need to check if the current directory (absCwd) is within the worktree being removed (absTargetPath).

@satococoa
Copy link
Owner Author

@codex fix tests.

Run go test -race -coverprofile=coverage.out -covermode=atomic ./...
--- FAIL: TestRemoveCommand_FailsWhenRemovingCurrentWorktree (0.00s)
    --- FAIL: TestRemoveCommand_FailsWhenRemovingCurrentWorktree/exact_worktree_path (0.00s)
        remove_test.go:432: 
            	Error Trace:	/Users/runner/work/wtp/wtp/cmd/wtp/remove_test.go:432
            	Error:      	"worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees" does not contain "cannot remove worktree 'feature/foo'"
            	Test:       	TestRemoveCommand_FailsWhenRemovingCurrentWorktree/exact_worktree_path
    --- FAIL: TestRemoveCommand_FailsWhenRemovingCurrentWorktree/nested_directory_inside_worktree (0.00s)
        remove_test.go:432: 
            	Error Trace:	/Users/runner/work/wtp/wtp/cmd/wtp/remove_test.go:432
            	Error:      	"worktree 'feature/foo' not found\n\nNo worktrees found.\n\nTip: Run 'wtp list' to see all worktrees" does not contain "cannot remove worktree 'feature/foo'"
            	Test:       	TestRemoveCommand_FailsWhenRemovingCurrentWorktree/nested_directory_inside_worktree
FAIL
coverage: 74.8% of statements
FAIL	github.com/satococoa/wtp/cmd/wtp	0.294s
ok  	github.com/satococoa/wtp/internal/command	1.112s	coverage: 91.5% of statements
ok  	github.com/satococoa/wtp/internal/config	1.109s	coverage: 88.9% of statements
ok  	github.com/satococoa/wtp/internal/errors	1.146s	coverage: 86.4% of statements
ok  	github.com/satococoa/wtp/internal/git	2.191s	coverage: 84.7% of statements
ok  	github.com/satococoa/wtp/internal/hooks	1.554s	coverage: 91.1% of statements
ok  	github.com/satococoa/wtp/internal/io	1.115s	coverage: 88.2% of statements
ok  	github.com/satococoa/wtp/test/e2e	19.678s	coverage: [no statements]
	github.com/satococoa/wtp/test/e2e/framework		coverage: 0.0% of statements
FAIL
Error: Process completed with exit code 1.

@chatgpt-codex-connector
Copy link

Summary

  • Corrected the current-worktree guard to check whether the present working directory resides within the target worktree before removal. cmd/wtp/remove.goL150-L168
  • Updated the removal command unit test fixture to place the mocked worktree under the managed worktrees directory so the guard triggers as intended. cmd/wtp/remove_test.goL393-L429

Testing

  • ⚠️ go test ./... (fails: existing init and hook tests expect permission errors that do not occur in this environment, resulting in nil-error panics)

View task →

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
cmd/wtp/remove_test.go (1)

393-441: Good fix and coverage for current-worktree guard.

Path now aligns with default base_dir (/repo/worktrees), resolving the earlier “worktree not found” mismatch; table covers exact and nested cwd cases and asserts no remove command runs.

🧹 Nitpick comments (1)
cmd/wtp/remove.go (1)

206-221: Clarify isPathWithin semantics.

Add a brief comment/docstring noting it returns true when targetPath is equal to or within basePath; prevents future call-site mixups.

-func isPathWithin(basePath, targetPath string) bool {
+// isPathWithin returns true if targetPath is the same as, or a descendant of, basePath.
+func isPathWithin(basePath, targetPath string) bool {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e23691 and 4b6f91c.

📒 Files selected for processing (2)
  • cmd/wtp/remove.go (3 hunks)
  • cmd/wtp/remove_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*.go: Run gofmt and goimports; keep imports grouped and organized; local import prefix follows module path github.com/satococoa/wtp
Adhere to golangci-lint rules configured for the project (vet, staticcheck, gosec, mnd, lll=120, etc.)
Errors should be wrapped with context and must not be ignored
Use snake_case for Go filenames; document exported identifiers when non-trivial

Files:

  • cmd/wtp/remove.go
  • cmd/wtp/remove_test.go
cmd/wtp/**

📄 CodeRabbit inference engine (AGENTS.md)

cmd/wtp/**: CLI entrypoint and commands are implemented under cmd/wtp
Update CLI help text to reflect user-facing changes
Command behavior: wtp cd prints only the absolute worktree path with no side effects
Command behavior: wtp completion generates pure completion scripts via urfave/cli
Command behavior: wtp hook emits shell functions that intercept wtp cd; wtp shell-init combines completion and hook output

Files:

  • cmd/wtp/remove.go
  • cmd/wtp/remove_test.go
**/*_test.go

📄 CodeRabbit inference engine (AGENTS.md)

**/*_test.go: Unit tests live alongside packages and use *_test.go naming
Prefer table-driven tests and mock git operations in unit tests

Files:

  • cmd/wtp/remove_test.go
🧬 Code graph analysis (2)
cmd/wtp/remove.go (1)
internal/errors/errors.go (3)
  • WorktreeRemovalFailed (133-166)
  • DirectoryAccessFailed (240-264)
  • CannotRemoveCurrentWorktree (168-173)
cmd/wtp/remove_test.go (1)
internal/command/types.go (2)
  • Result (11-15)
  • Command (4-8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: E2E Tests (macos-latest)
🔇 Additional comments (2)
cmd/wtp/remove_test.go (1)

6-6: Import addition is appropriate.

fmt is needed for Sprintf below; no issues.

cmd/wtp/remove.go (1)

132-139: Passing cwd improves testability and clarity.

Decouples path resolution from execution; nice.

@satococoa satococoa self-assigned this Oct 22, 2025
@satococoa satococoa merged commit fbfb54c into main Oct 22, 2025
7 checks passed
@satococoa satococoa deleted the codex/design-wtp-remove-behavior-for-current-wotktree branch October 22, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant