feat(files): treat in-repo .worktrees/ checkouts as ignored (T-511)
D-106 supports opening a worktree under <repo>/.worktrees/ as its own workspace; the dir itself is sibling checkouts, not tree content — so the builtin ignore set hides it and the project-init scaffold gitignores it alongside .clide/. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,7 +84,7 @@ void _writeScaffold(String dir, String name) {
|
||||
// Claude with an empty CLAUDE.md stub. No language/framework templates. Never
|
||||
// clobbers — safe to run over an existing folder (T-489).
|
||||
final gitignore = File('$dir/.gitignore');
|
||||
if (!gitignore.existsSync()) gitignore.writeAsStringSync('# clide\n.clide/\n');
|
||||
if (!gitignore.existsSync()) gitignore.writeAsStringSync('# clide\n.clide/\n.worktrees/\n');
|
||||
final claudeMd = File('$dir/CLAUDE.md');
|
||||
if (!claudeMd.existsSync()) claudeMd.writeAsStringSync('# $name\n\nGuidance for Claude Code in this project.\n');
|
||||
}
|
||||
|
||||
@@ -162,5 +162,7 @@ class IgnoreSet {
|
||||
/// ignore files. Matches D-004's "walker magic: none except
|
||||
/// `.git/`" — but the tree-view UI benefits from hiding `.pql/` and
|
||||
/// `.dart_tool/` too since users never edit those by hand.
|
||||
static IgnoreSet builtin() => IgnoreSet.parse(const ['.git/\n.pql/\n.clide/\n.dart_tool/\nbuild/\nnode_modules/\n']);
|
||||
/// `.worktrees/` holds in-repo linked worktrees (D-106) — sibling
|
||||
/// checkouts a user opens as their own workspaces, not tree content.
|
||||
static IgnoreSet builtin() => IgnoreSet.parse(const ['.git/\n.pql/\n.clide/\n.dart_tool/\n.worktrees/\nbuild/\nnode_modules/\n']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user