fix(shell): avoid false fuzzy matches in branch names#14
Conversation
Parse shell wrapper flags exactly so branch names containing '-f' do not trigger the interactive path. Also cover the 's' alias in wrapper tests and ensure explicit fuzzy mode still resolves the target worktree correctly.
|
Claude finished @tobiase's task —— View job PR Review: fix(shell): avoid false fuzzy matches in branch namesTodo List:
SummaryThis PR fixes a critical bug where branch names containing ✅ Code Quality & Best PracticesExcellent implementation approach:
Good separation of concerns:
✅ Bug Analysis & Fix QualityRoot cause correctly identified:
Robust solution:
✅ Test Coverage & Integration TestsComprehensive test scenarios in New test cases (lines 224-235): {
name: "branch names containing -f do not trigger fuzzy mode",
command: "wt s 2026-03-04-form-tracking-debug-floating-report",
checkScript: `pwd`,
expectOutput: "/test/branch-with-f",
rejectOutput: "CD:/test/branch-with-f", // Ensures no raw output
}Excellent test design:
Mock binary approach (lines 310-368):
✅ Security & PerformanceSecurity considerations:
Performance impact:
✅ Edge Cases & RobustnessWell-handled edge cases:
Potential considerations (minor):
✅ Documentation & CommentsGood inline documentation:
🎯 Recommendations
Final AssessmentThis is an excellent PR that:
Recommendation: APPROVE ✅ The fix is production-ready and significantly improves the reliability of the shell wrapper for users with dash-containing branch names. |
Summary
-f-fon the normal non-interactive pathsalias and explicit fuzzy mode with integration testsRepro
wt s 2026-03-04-form-tracking-debug-floating-reportprinted a rawCD:/...line instead of switching, because the wrapper treated the branch name as if-fhad been passed.Testing
go test ./test/integration -run 'TestShellWrapperScript|TestShellWrapper'go test ./...make install-local