Before submitting
Area
apps/server
Steps to reproduce
A common layout for worktree-heavy work puts a bare repo at <root>/.bare, a <root>/.git file pointing at it, and every branch as a sibling checkout — no primary working copy:
mkdir myproj && cd myproj
git clone --bare git@github.com:owner/repo.git .bare
echo "gitdir: ./.bare" > .git
git worktree add develop develop
git worktree add feature-x -b feature-x
Result:
myproj/
├── .bare/
├── .git → gitdir: ./.bare
├── develop/
└── feature-x/
- Add
myproj/ as a project in T3 Code.
- Open the Changes/Diff view, or start a thread.
Expected behavior
The root is rejected at add time with a message explaining that it is a bare-root layout and that an individual worktree should be added instead. Adding myproj/develop directly already works correctly today, so the fix is to stop accepting a root that cannot be a coherent workspace — not to add support for the layout itself.
Actual behavior
The root is accepted as an ordinary repository with no warning. detectRepository in apps/server/src/vcs/GitVcsDriver.ts gates on git rev-parse --is-inside-work-tree, and because the clone leaves core.bare=false, git reports:
$ git -C myproj rev-parse --is-inside-work-tree --show-toplevel --git-common-dir
true
/path/to/myproj
/path/to/myproj/.bare
So rootPath becomes myproj — the parent directory of every worktree. Downstream that means git status treats develop/ and feature-x/ as untracked entries, the diff/changes view is scoped to a directory that contains N independent checkouts, and any thread started there runs an agent whose cwd spans all of them. .bare/ itself is correctly rejected (--is-inside-work-tree is false), so the failure is specific to the root.
There is no bare-specific handling anywhere in the git layer — GitManager.ts mentions "bare" once, about branch names.
Impact
Minor bug or occasional failure
Version or commit
0.0.33 (macOS desktop)
Environment
macOS 26.5.2, git 2.50.1
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Add each worktree directory as its own project and never add the root.
detectRepository already calls git rev-parse --git-common-dir alongside --show-toplevel, so the detection needs no new git calls: a common dir that sits inside rootPath but is not rootPath/.git identifies this layout.
Before submitting
Area
apps/server
Steps to reproduce
A common layout for worktree-heavy work puts a bare repo at
<root>/.bare, a<root>/.gitfile pointing at it, and every branch as a sibling checkout — no primary working copy:Result:
myproj/as a project in T3 Code.Expected behavior
The root is rejected at add time with a message explaining that it is a bare-root layout and that an individual worktree should be added instead. Adding
myproj/developdirectly already works correctly today, so the fix is to stop accepting a root that cannot be a coherent workspace — not to add support for the layout itself.Actual behavior
The root is accepted as an ordinary repository with no warning.
detectRepositoryinapps/server/src/vcs/GitVcsDriver.tsgates ongit rev-parse --is-inside-work-tree, and because the clone leavescore.bare=false, git reports:So
rootPathbecomesmyproj— the parent directory of every worktree. Downstream that meansgit statustreatsdevelop/andfeature-x/as untracked entries, the diff/changes view is scoped to a directory that contains N independent checkouts, and any thread started there runs an agent whose cwd spans all of them..bare/itself is correctly rejected (--is-inside-work-treeis false), so the failure is specific to the root.There is no bare-specific handling anywhere in the git layer —
GitManager.tsmentions "bare" once, about branch names.Impact
Minor bug or occasional failure
Version or commit
0.0.33 (macOS desktop)
Environment
macOS 26.5.2, git 2.50.1
Logs or stack traces
Screenshots, recordings, or supporting files
No response
Workaround
Add each worktree directory as its own project and never add the root.
detectRepository already calls git rev-parse --git-common-dir alongside --show-toplevel, so the detection needs no new git calls: a common dir that sits inside rootPath but is not rootPath/.git identifies this layout.