Skip to content

fix(project): keep bare worktree roots checked out#25860

Open
osamu2001 wants to merge 1 commit intoanomalyco:devfrom
osamu2001:fix/bare-worktree-desktop-root
Open

fix(project): keep bare worktree roots checked out#25860
osamu2001 wants to merge 1 commit intoanomalyco:devfrom
osamu2001:fix/bare-worktree-desktop-root

Conversation

@osamu2001
Copy link
Copy Markdown

@osamu2001 osamu2001 commented May 5, 2026

Issue for this PR

Closes #10643

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Keeps project.worktree pointed at the checked-out worktree for bare-repo-backed worktrees.

The project ID cache still uses git-common-dir, so the previous bare repo cache collision fix is preserved. This separates the cache location from the workspace root used by desktop/sidebar/cwd surfaces.

How did you verify your code works?

  • bun test --timeout 30000 test/project/project.test.ts --test-name-pattern "bare repo"
  • bun test --timeout 30000 test/project/project.test.ts
  • bun typecheck
  • pre-push hook: bun turbo typecheck

Screenshots / recordings

N/A - project discovery logic only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

intent(project-worktree): desktop open-project should keep a selected bare-backed worktree as the project root instead of collapsing to the bare git common dir
constraint(project-cache): project id cache must still live in git-common-dir to avoid sibling bare repo collisions
rejected(project-worktree): using the bare repo path as project.worktree because UI and cwd surfaces treat that field as a checked-out workspace root
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.

Worktrees created from bare repos are not recognized

1 participant