Conversation
When sidecar is started from a git repo subfolder, WorkDir is set to that subfolder (e.g. /repos/myrepo/subfolder). Both doCreateWorktree and fetchAndCreateWorktree were computing the new worktree's parent directory as filepath.Dir(WorkDir), which resolves to the git root itself — placing the new worktree *inside* the main repo instead of beside it. Fix: use ProjectRoot (already correctly resolved to the main worktree path via GetMainWorktreePath) instead. When ProjectRoot is empty fall back to WorkDir for safety. Adds a regression test documenting the path-computation invariant. Fixes #174
Documents the automatic setup that runs when a worktree is created: - Env file copying (.env, .env.local, .env.development, .env.development.local) - Directory symlinking (opt-in via symlinkDirs config) - .worktree-setup.sh hook with env vars and examples Cross-references from workspaces-plugin.md.
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.
Adds documentation for the automatic setup that runs when a worktree is created.
What's documented
symlinkDirsconfig, when to use it.worktree-setup.shhook — how to create it, available env vars (MAIN_WORKTREE,WORKTREE_BRANCH,WORKTREE_PATH), practical examplesChanges
website/docs/worktree-setup.mdwebsite/docs/workspaces-plugin.md— cross-reference added in the "what happens on creation" sectionBuild verified:
npm run buildpasses.