Skip to content

fix: keep worktrees with ignored local files out of automatic cleanup (INC-486) - #541

Merged
arzafran merged 3 commits into
mainfrom
franco/inc-486-worktree-ignored
Nov 5, 2026
Merged

arzafran merged 3 commits into
mainfrom
franco/inc-486-worktree-ignored

Conversation

@arzafran

@arzafran arzafran commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

The background worktree cleanup only protected ignored .env files, so other ignored local state was deleted along with the worktree: .claude/settings.local.json, .dev.vars, local databases, and nested clones with unpushed commits.

Automatic cleanup now keeps any worktree that holds an ignored file outside the known build and dependency folders (node_modules, build, .build, DerivedData and similar). It rechecks right before removing. If git can't answer, the worktree is kept. The background pass also skips these git probes for worktrees it already keeps for cheaper reasons.

Manual cleaning from the Storage panel or the CLI is unchanged.

Tests: new tests with real temp repos, plus settings default and clamp tests. Not run in a running app.

Fixes INC-486

CI fix: the nested-repository check counted directories that git lists as dir/ as ignored .env files, which failed two tests. They are no longer counted.

@arzafran
arzafran merged commit 0910509 into main Nov 5, 2026
12 checks passed
@arzafran
arzafran deleted the franco/inc-486-worktree-ignored branch November 5, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant