Repository navigation
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The fix distinguishes separate Git directories from linked worktrees, but also changes affected checkouts from local .t3 state to the environment/shared home by default. Confirm that this database-target transition is intended, including for pairing commands that may run migrations. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…orktreePath Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceLinux x86_64, real dev server, fresh databases, no seed. On both commits, clone with a separate Git directory at
Genuine linked-worktree controls retain isolated defaults on base and head. Driver · Before transcript · After transcript Not shown:
|


Problem
A main checkout whose separate Git directory sits under a folder named
worktreeswas treated as a linked worktree, so it got a checkout-local.t3home instead of the normal one. The detector only checked whether the.gitfile'sgitdir:ended inworktrees/<name>, andgit init --separate-git-dircan produce that path too.Deterministic repro on
origin/main(27c4aad697f98c0fcda026e2167ac6966a3c1c15):Then call
resolveWorktreeT3Home("<tmp>/main")from@t3tools/shared/devHome. The regression test inpackages/shared/src/devHome.test.tsdoes exactly this.<tmp>/main/.t3.undefined, the same as any other main checkout.Change
When the path matches
worktrees/<name>and the Git directory exists,resolveGitWorktreePathnow also requires Git'scommondirfile. Git writes that file for every linked worktree, including worktrees of bare repositories and custom common dirs. If the Git directory can't be read, the code still treats the checkout as a linked worktree, so a real worktree can't fall through to the live home.All callers share this resolver, so such a checkout now gets main-checkout behavior everywhere:
t3 pairdiscovery fall back to the normal home.migrate-dev-dbwithout--base-dirstops with its existing "not in a worktree" error.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
ignores a main checkout whose separate Git directory is under worktreesuses realgit init --separate-git-dir. It first asserts that Git's git-dir and common-dir match, then thatresolveWorktreeT3Homereturnsundefined. On base it fails withexpected '<tmp>/main/.t3' to equal undefined; on head it passes.finds a real linked worktree whose Git directory existsruns a realgit worktree add --detachand passes on both base and head, so linked-worktree detection is unchanged. The existing bare-repo and custom common-dir worktree tests still pass.GIT_CONFIG_GLOBAL=/dev/null,GIT_CONFIG_NOSYSTEM=1). The file also passes under a hostile global config (commit.gpgsign=truewith a failinggpg.program,init.defaultBranch=linked).vp run check:changedexited 0 on HEAD2922e4d73fea62231cdd906b75d0f24e64540fc6(format, lint, knip, typecheck, tests).Not shown: I only ran the resolver itself, not the code that calls it. I did not run a dev server,
t3 pair,migrate-dev-db, storage cleanup or ascenarios:provescenario inside such a checkout; I only read their code. Also not shown: Windows paths, and linked worktrees whose Git directory can't be read (those still count as linked worktrees, which is today's behavior).Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown