Commit Graph
9 Commits
Author SHA1 Message Date
Brennan Benson 8c30d6dada fix(worktrees): harden include matching 2026-07-22 15:48:33 -07:00
Brennan Benson ac9bb3b2fe fix(worktrees): bound include filesystem resolution 2026-07-22 14:31:10 -07:00
Brennan Benson 504a1ebd21 fix(worktrees): preserve bounded include resolution 2026-07-22 13:39:01 -07:00
Brennan Benson 5284a2e6c8 fix(worktrees): harden include resolution 2026-07-22 12:46:08 -07:00
Brennan Benson de9c845371 fix(worktrees): close include correctness and perf gaps 2026-07-21 18:45:41 -07:00
Brennan Benson 7f5f9f4d70 fix(worktrees): bound include copy costs 2026-07-21 17:55:10 -07:00
Brennan Benson bf50aa97d5 fix(worktrees): support nested includes on Git 2.25 2026-07-21 16:34:39 -07:00
Brennan Benson 0403321500 fix(worktrees): harden worktree include copying 2026-07-21 16:20:35 -07:00
Brennan Benson 4471e8a2e6 feat(worktrees): copy project-level .worktreeinclude paths into new worktrees
Read .worktreeinclude at the repo root (gitignore syntax) and copy matching
gitignored paths from the primary checkout into each newly created local
worktree, so .env and other local config carry over with zero per-user setup.

- Literal patterns resolve by direct stat; globs match against
  ls-files --others --ignored --exclude-standard --directory (collapsed
  dirs keep huge repos fast); every candidate is re-verified with
  check-ignore so tracked or unignored files are never copied.
- Copy semantics, never symlink: APFS clone-copy on macOS, real copy
  elsewhere, so each worktree owns its files (unlike repo.symlinkPaths,
  which it merges with rather than replaces).
- Failures never block worktree creation.
- Remote (SSH) creation skips it, same as symlinkPaths.
- Split APFS clone helpers into worktree-apfs-clone.ts (max-lines).

Closes #7549
2026-07-21 16:03:31 -07:00