Skip to content

Fix worktree protection detection for separate gitdir layouts#2

Merged
crrow merged 3 commits intomainfrom
rara/multica-devkit-worktree-tui-fix
Apr 27, 2026
Merged

Fix worktree protection detection for separate gitdir layouts#2
crrow merged 3 commits intomainfrom
rara/multica-devkit-worktree-tui-fix

Conversation

@crrowbot
Copy link
Copy Markdown
Collaborator

@crrowbot crrowbot commented Apr 13, 2026

Summary

  • detect main vs linked worktrees from resolved gitdir metadata instead of checking whether the .git path is a directory
  • keep main checkouts created with the separate-git-dir layout protected from clean and nuke flows
  • add regression coverage for main worktrees whose .git is a file

Validation

  • gofmt -w internal/worktree/git.go internal/worktree/git_test.go
  • go test ./internal/worktree/...
  • go test ./...

@crrow crrow force-pushed the rara/multica-devkit-worktree-tui-fix branch from c365f48 to e443228 Compare April 27, 2026 09:08
@crrow crrow merged commit bbf0ca5 into main Apr 27, 2026
2 of 3 checks passed
crrow added a commit that referenced this pull request Apr 27, 2026
- Pass Entry to shouldClean/shouldNuke by pointer
- Drop redundant tc := tc copyloopvar in commands_test
- Switch runGit to exec.CommandContext and return nothing

Lint failed on main after squash-merge of #2: hugeParam,
copyloopvar, noctx, and unparam findings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants