Repository navigation
Conversation
…iles Reads .worktreeinclude from the project root (same syntax as .gitignore) and copies matched files into newly created worktrees. Standard build directories (node_modules, dist, .next, target, …) are pruned during the walk so monorepos don't incur a large traversal cost. Users can override the prune by explicitly listing a directory in .worktreeinclude.
Calls WorktreeInclude.apply in boot() after git reset --hard and in reset() after git clean, so gitignored files (e.g. .env) are present before startup scripts run. Passes fs and pathSvc explicitly to avoid a Service-not-found die in the forked boot fiber used by the desktop.
- Move all diagnostic logs ("applied", "partial failure") inside
WorktreeInclude.apply so the boot/reset call sites only swallow
unexpected causes.
- Extract a single applyInclude(source, destination) helper in the
Worktree layer, replacing two ~30-line copies in boot() and reset().
- Inline the trivial walk() wrapper into apply(); drop the redundant
makeDirectory(parent) in copyOne's directory branch since
copyDirectoryRecursive already handles it.
- Replace per-test makeTmp/write/exists boilerplate with a setup()
helper that returns scoped temp dirs (auto-cleanup on test scope
end) plus write/read/exists/apply closures bound to those dirs.
Cleanup now runs even when assertions throw.
Contributor
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
1 task done
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
When creating a new git worktree (workspace), gitignored files like `.env` or `.env.local` are not checked out since they are untracked. This PR adds support for a `.worktreeinclude` file in the project root that lists which files should be copied into every new worktree — using the same `.gitignore` syntax already familiar to users (and compatible with Claude Code's own `.worktreeinclude` feature).
How it works:
Why `fs` and `pathSvc` are passed as arguments instead of yielded as services:
The desktop app calls `Worktree.create`, which forks `boot()` into a background fiber via `Effect.forkIn(scope)`. In that forked context the ambient Effect service registry no longer contains `effect/Path`, causing a `Service not found` die. Passing the already-resolved services from the outer layer closure avoids this entirely.
Example `.worktreeinclude`:
```
.env
.env.local
config/secrets.json
```
How did you verify your code works?
Screenshots / recordings
No UI changes.
Checklist