fix(vscode): harden Git worktree path resolution - #13863
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 114.3K · Output: 16.6K · Cached: 217K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
September 7, 2026 10:47
WebReflection
approved these changes
Sep 7, 2026
WebReflection
left a comment
Contributor
There was a problem hiding this comment.
minor non-blocking comment, feel free to ignore it or follow up
This was referenced Sep 8, 2026
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.
What Problem This Solves
Related to #13843. On Windows, the extension project-root resolver can accept malformed
git rev-parseoutput as a directory. With older Git, the unsupported--path-format=absoluteoption can be echoed into stdout. If linked-worktree discovery then fails, that malformed value can be sent as the indexing directory and later fail in the CLI duringrealpath.Why This Change Was Made
The resolver does not need
--path-format=absolute:--show-toplevelis already absolute, and Git metadata paths can be resolved relative to the Git command directory. The resolver now removes the unnecessary option, rejects option-contaminated top-level output, validates worktree paths, and retriesgit worktree list --porcelainwhen the NUL-delimited-zform is unavailable. This keeps older Git linked worktrees mapped to the primary checkout instead of accepting a malformed path or losing shared baseline routing.User Impact
Windows users opening subfolders of linked worktrees should no longer send an invalid VS Code-prefixed path to indexing when Git does not support the newer options. Valid Unicode and space-containing worktree paths remain supported.
This addresses the confirmed malformed-path mechanism from #13843. The reporter's exact native Windows Git version and character-level path corruption were not available for reproduction, so the PR does not claim to prove every symptom in that report.
Evidence
kilocode_changechecks passed.Manual Test
On Windows, use Git with a linked worktree under a non-ASCII path, open a nested subfolder in VS Code, open Kilo Settings > Indexing, and enable indexing. The project should resolve to a valid checkout path and should not show an
ENOENT realpathinitialization error.