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>