feat: add worktree strategies and branch sanitization#42
Merged
Conversation
- Fix variable shadowing bug where err from git-common-dir could pollute the remote URL check, causing wrong Host/Owner values - Add parseRemoteURL negative-case unit tests (empty, no-path, etc.) - Add E2E tests for checkout/remove with non-global strategy - Add E2E tests for wt info command and invalid strategy name - Add wt info to shell completion lists (bash, zsh, powershell) - Update README with wt info command and configurable strategies
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
+ Coverage 23.15% 24.67% +1.52%
==========================================
Files 3 3
Lines 1071 1313 +242
==========================================
+ Hits 248 324 +76
- Misses 788 948 +160
- Partials 35 41 +6
🚀 New features to boost your workflow:
|
Add env field to E2E Step struct so environment variables can be set portably across bash, zsh, and PowerShell. This replaces inline VAR=value command syntax (bash-only) with proper export/: emission per shell, fixing failures on Linux and Windows.
The script(1) PTY wrapper on Linux does not propagate exit codes, causing tests that expect exit_code: 1 to fail. Use skip_shellenv and call $WT_BIN directly for error-path tests, consistent with how remove/remove_nonexistent_fails already works.
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
Rebased and improved version of #38 by @brosu — adds configurable worktree placement strategies.
global(default),sibling-repo,parent-branches,parent-worktrees,parent-dotdir,inside-dotdir,custom{.branch},{.branchSafe},{.repo.Name},{.repo.Main},{.repo.Owner},{.repo.Host},{.worktreeRoot}wt infocommand to show active strategy, pattern, and available variablesWORKTREE_STRATEGY,WORKTREE_PATTERN,WORKTREE_ROOTChanges on top of #38
errvariable shadowing ingetRepoInfo()where the common-dir fallback could pollute the remote URL check, producing wrong Host/Owner valuesparseRemoteURLnegative-case tests (empty, no-path, single-component, etc.)wt checkoutandwt removewith non-global strategy,wt infooutput, and invalid strategy nameinfoto bash, zsh, and PowerShell completion listswt infoto commands, added discovery hint in configuration sectionTest results
Based on #38 — thank you @brosu for the original implementation!