Repository navigation
Conversation
A worktree's project root was the parent of its common git dir. For a bare clone (`parent/repo.git`) that parent is the folder holding every clone, so the worktrees of all repos there fell into one project (and that folder became an allowed file root), while the clone itself was a project of its own with none of its sessions. New worktrees were added from that parent too, which is no repository. A bare clone is now its own root, unless a `.git` file beside it points at it (the `project/.bare` layout keeps the enclosing folder). Removed worktrees under `repo.git-worktrees/` are still inferred back into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A worktree's project root was the parent of its common git dir. For a bare clone (
parent/repo.git) that parent is the folder holding every clone, so the worktrees of all repos there fell into one project group (andparentbecame an allowed file root), while the clone itself resolved to its own, empty project. "New worktree…" also rangit worktree addfromparent, which is not a repository.Reproduced with real
git clone --bare+git worktree add:parent/repo1.git/worktree1andparent/repo2.git/worktree1both resolved toparent.lib/worktree.ts:repoRootFromCommonDir()— the folder holding the common git dir is the root only when that dir is.git, or a.gitfile in that folder points at it (theproject/.barelayout). Any other bare clone is its own root. Used for project resolution and forgetRepoRoot(), so new worktrees are created from the clone (inrepo.git-worktrees/).inferRemovedWorktree()recognizes a bare clone (HEAD, objects/, refs/) so sessions of a removed worktree still group back under it..barelayout resolve exactly as before.Test: real-git regression in
lib/worktree.test.mjs(two bare clones under one parent, the.barelayout, adding a worktree, a removed worktree); fails on main. Note indocs/agents/files-and-access.md.tsc, eslint,npm testpass.Closes #1049
🤖 Generated with Claude Code