fix: display folder name instead of branch name in remove command #53
+1
−1
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.
Pull Request
Description
Fix the remove command to display the folder name instead of the current branch name in the log message, making it consistent with the create command.
Motivation
The remove command was displaying the current branch name (
$branch_name) instead of the folder name being removed. This was confusing when:feature/auth→ folderfeature-auth)--namesuffix was used during creationSince
git gtr rmremoves a folder (worktree), the log message should show what is actually being removed.Fixes #52
Type of Change
Testing
Manual Testing Checklist
Tested on:
Core functionality tested:
git gtr new <branch>- Create worktreegit gtr go <branch>- Navigate to worktreegit gtr editor <branch>- Open in editor (if applicable)git gtr ai <branch>- Start AI tool (if applicable)git gtr rm <branch>- Remove worktreegit gtr list- List worktreesgit gtr config- Configuration commands (if applicable)Test Steps
git gtr new feature/testgit gtr rm feature/test==> Removing worktree: feature-testExpected behavior: Log message shows folder name being removed.
Actual behavior: Log message now correctly shows folder name.
Additional tests:
--namesuffix - shows full folder name (verified)Breaking Changes
Checklist
Before submitting this PR, please check:
git gtr(production) and./bin/gtr(development)Additional Context
The fix uses
$(basename "$worktree_path")which follows existing codebase conventions (e.g., line 858 uses the same inline pattern for log messages).License Acknowledgment
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache License 2.0.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.