Repository navigation
fix(server): resolve git common dirs through symlinked subdirectories - #18152
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused server bug fix that resolves Git’s relative common-directory paths against the physical working directory, correcting checkpoint and ref discovery for symlinked subdirectories while preserving ordinary behavior. Regression tests cover both affected flows, with no schema, configuration-default, or static-analysis changes. You can add or adjust custom eligibility rules. Learn more. |
|
Warning Review limit reachedOnly developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing. Next included review available in 4 minutes. View limit details
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Dismissing prior approval to re-evaluate f725ef5
c34f027 to
6572c84
Compare
…ctories Git's relative --git-common-dir is computed from the physical working directory. Joining it with path.resolve walked out of a symlink into a repository subdirectory, so checkpoint capture wrote its index into a missing directory or a different repository. Ask for an absolute common dir in checkpoint capture and repository path lookup. The regression tests create the decoy repository before the only lookup, so a cached pre-decoy result cannot hide the wrong path.
6572c84 to
7389f15
Compare
|
Taking over this one as maintainer for batch worktree-git-08. I’ll preserve the symlink-resolution fix, reduce regression coverage to the necessary behaviors, merge current main, and push follow-up commits here. Thanks @macodev00 for the reproduction and fix. |
…eckpoint-capture-redo2-9e22-v2 # Conflicts: # apps/server/src/vcs/GitVcsDriver.test.ts
Dismissing prior approval to re-evaluate 487a72b
# Conflicts: # apps/server/src/vcs/GitVcsDriver.test.ts # apps/server/src/vcs/GitVcsDriver.ts
Dismissing prior approval to re-evaluate a476a75
…pingdotgg#18152) Co-authored-by: macodev00 <macodev00@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com> (cherry picked from commit 6e1bf41)
Projects opened through a symlink into a repository subdirectory could resolve Git’s relative common directory into a missing directory or another repository. Checkpoint capture then failed or placed its scratch index in the wrong repository; ref discovery could list the wrong repository’s branches.
Resolve relative common-directory paths against the physical working directory at both call sites. This keeps older Git working without requiring
rev-parse --path-format. Existing path normalization remains in place.Fixes #13187. Maintainer takeover of this PR, with credit to @macodev00 for the original fix and decoy-repository reproduction. Contributor history is preserved, with current main merged into the branch.
Verification of 487a72baf1 on headless Linux (Node 24.21.0, Git 2.43.0):
previousPathreview-diff failure, reproduced with main’s production files. The final rerun has the same result: 226 passed and that one failure.Proof uses real temporary Git repositories through the server driver. No client UI changed, so screenshots are not applicable. No browser or running application was used. macOS, Windows, iOS, Android, and Electron desktop were not verified; no pre-2.31 Git binary was available. CI on this head remains a separate readiness gate. No merge was performed.
Implementation: Codex GPT-6.1-Sol (high), tests: Codex GPT-6-Astra (high), reviews: Claude Opus 5.5 and Codex GPT-6-Sol, all through T3 Code’s delegated agents; parent: GPT-6.1-Sol in the Codex harness.