Git lists untracked folders such as apps/ beside the ignored entries in
them; searching those walked apps/web/node_modules/. Search only folders
check-ignore reports, skip a folder at or below the depth of a pattern
without **, strip a leading UTF-8 BOM from .worktreeinclude as git does,
and match with the source repo's core.ignoreCase.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prefix paths sent to check-ignore with ./ so a file named like pathspec
magic (`:(x`, `:!x`) no longer fails worktree creation, create the scratch
repo with an empty template so the user's template info/exclude adds no
patterns, and search a glob-free pattern's whole path instead of its
parent folder, so `node_modules/.cache` no longer walks node_modules/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Match ignored entries with check-ignore --no-index instead of recreating
them on disk, search inside an ignored folder only as deep as the pattern
names it, copy each file once, and note in the docs that **/ patterns
search every ignored folder.
worktree-include listed candidates with `git ls-files --others --ignored
--exclude-from=.worktreeinclude`. With only the include patterns as
excludes, git does not treat node_modules/ and other ignored folders as
ignored, so it walks every file in them. On a large repo the walk outlasts
the 30 s plugin hook limit and worktree creation fails and rolls back.
List ignored entries with --exclude-standard --directory instead, so an
ignored folder is one entry, match those entries against .worktreeinclude
in a scratch repository, and search inside an ignored folder only when a
pattern matches it or names a path inside it.
A bare name such as `.env` no longer finds `node_modules/pkg/.env`; the
docs say how to name such a path.
Closes#10004
Co-authored-by: mgranderath <22001111+mgranderath@users.noreply.github.com>
* feat(worktrees): copy included local files before setup and agents
Keep local-file materialization in one built-in lifecycle hook so workspace setup and the first agent see the completed copy. Reuse the community plugin algorithm with the source checkout supplied by the worktree hook.
Co-authored-by: Carlos Precioso <github@precioso.design>
* test(plugins): make worktree lifecycle checks portable on Windows
Compare source checkout filesystem identity across Git and Windows path spellings. Exercise copy rollback with a destination file blocking a directory, since Git for Windows accepts directories as exclude files.
---------
Co-authored-by: Carlos Precioso <github@precioso.design>