Repository navigation
Conversation
A dashboard started in a package directory lists paths from the worktree root. Passing those paths back to Git could preview or stage a different file with the same name. Run file operations with literal paths from the appropriate directory. Keep explicit cwd-relative paths in mixed requests and preserve the spelling of filenames in history and committed file reads. BREAKING CHANGE: Bare filenames in a nested Git service select files at the worktree root. Use ./ to select a file in the service directory. For multiple files, pass a directory or an explicit list of filenames instead of a Git pathspec pattern.
|
@SaKaNa-Y is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
|
👁️🗨️ Review this pull request with grouped, summarized diffs at: raw result💭 analyzed by {
"headSha": "0b5feb6a44004a0fc0496e04a5934cd36fbb8893",
"result": {
"overallSummary": "Fixes a bug where the Git service, started from a nested package directory, could confuse a root file with a same-named package file (e.g. two `README.md`), leading to the wrong file being previewed or staged/unstaged, or an outright path error when both were selected. The fix makes file selection literal and resolved relative to the worktree root or the configured cwd, with new tests covering the collision scenarios and documentation of the (breaking) path semantics.",
"groups": [
{
"key": "path-resolution",
"label": "Resolve paths from worktree root",
"summary": "Reworks how the Git service resolves `stage`, `unstage`, `diff`, `log` and `readFile` paths so they are interpreted literally and relative to the worktree root instead of being naively prefixed with the service's cwd, fixing collisions between a root file and a same-named file in a nested package.",
"category": "core",
"filePaths": [
"services/git/src/git.ts",
"services/git/src/operations.ts",
"services/git/src/types.ts"
],
"critical": true,
"fileNotes": [
{
"path": "services/git/src/git.ts",
"text": "Core of the fix: `fileSelection` decides whether to run Git from the repo root or the configured cwd (to preserve relative GIT_* env settings), rewrites paths accordingly, and `fileArgs` builds literal, non-glob pathspec arguments.",
"critical": true
},
{
"path": "services/git/src/operations.ts",
"text": "`stage`/`unstage` are unified through a new `updateIndex` helper, and `log`/`diff`/`readFile` now go through `fileSelection`/`fileArgs` instead of trimming and appending raw paths after `--`."
}
]
},
{
"key": "tests",
"label": "Tests for path selection",
"summary": "Adds repo fixtures (edited files across root/package, shared worktrees) and tests covering root-vs-package collisions, literal bracket/space filenames, relative Git env settings, and shared-worktree index selection.",
"category": "tests",
"filePaths": [
"services/git/test/_repo.ts",
"services/git/test/git.test.ts"
],
"fileNotes": [
{
"path": "services/git/test/_repo.ts",
"text": "New `createEditedRepo` and `createSharedWorktreeRepo` helpers simulate a package nested inside the root repo, including a second Git directory sharing the outer worktree."
}
]
},
{
"key": "docs",
"label": "Document path semantics",
"summary": "Documents the new literal, root/cwd-relative path semantics for `diff`, `log`, `readFile`, `stage` and `unstage`.",
"category": "docs",
"filePaths": [
"docs/content/5.add-ons/2.services/2.git.md"
]
}
],
"schemaVersion": 1,
"source": "llm",
"generatedAt": "2026-12-01T14:51:16.566Z",
"model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
"locale": "en"
}
} |
Keep the Git subprocess in its original directory so relative worktree and index settings apply to the same repository. Anchor repository-relative filenames with Git pathspecs and preserve the configured diff headers for explicit and absolute package paths.
Pass groups from one directory to Git in their original spelling. For mixed groups, use Git’s own relative directory prefix and keep relative Git worktree and index settings bound to the service directory. Literal file arguments also retain Git’s normal handling of redundant path separators and dot components.
Keep root-based selections in the Git directory discovered from the service directory when different indexes share a worktree. For mixed selections, choose the base that adds fewer bytes to the Git arguments.
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.
Summary
When the Git dashboard starts in
packages/app, both the root and the package can have a modifiedREADME.md. The root row could show the package edit, and its Stage button could add the package README to the index. Selecting both rows could fail because Git looked forpackages/app/packages/app/README.md.The Git service now resolves each status path from the worktree root. An explicit path such as
./README.mdstill selects the file in the package. Preview, history, stage and unstage use this rule and treat filenames literally, so a route namedpages/[id].tsxcan be selected on its own. If two repositories share a worktree, each operation uses the repository opened by the service.Breaking
Callers that used
README.mdfor a file in the service directory should pass./README.mdor its full repository-relative path. Pass a directory or an explicit list of paths for a group. Callers that used Git patterns must expand them first. Passing.to stage or unstage still selects the service directory.Evidence
packages/appMerge Danger
Door · The code can be reverted. Recovering an overwritten staged version may require finding its unreferenced Git object.
Blast radius · High for index writes. Choosing the wrong file or repository can replace a staged version that differs from both the working file and its last commit. With two indexes sharing a worktree, unstaging the file now preserves the staged version in the other index.