Repository navigation
fix(git): read diff blobs without revision path fallback - #34778
Merged
Merged
Conversation
This was referenced Oct 28, 2026
…k to HEAD commit git show :<path> and git show HEAD:<path> treat a missing blob spec as a pathspec, exit 0, and print the HEAD commit when the path contains [, * or ?. Orca then showed the commit header as the original side of new files such as app/[id]/page.tsx. Read index and tree blobs with git cat-file blob, and on older Git that only reports 'Not a valid object name' prove absence with an empty literal ls-files/ls-tree probe.
OrcaWin
force-pushed
the
OrcaWin/git-literal-blob-read
branch
from
October 30, 2026 08:36
a7ea609 to
711bfb4
Compare
OrcaWin
marked this pull request as ready for review
October 30, 2026 08:36
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.
Problem
For paths containing glob characters (
[,*,?), such as Next.js/SvelteKit routes likeapp/[id]/page.tsxor[...slug].tsx, the diff view of a new or added file showed the latest commit's header and message as the "original" side.git show :<path>andgit show --end-of-options HEAD:<path>fall back to pathspec mode when the blob does not exist. They exit 0 and print the HEAD commit, and Orca read that output as blob content withexists: true. This affected untracked diffs, staged additions, and commit/branch comparisons where one side is absent.Fix
Index and tree blob reads now use
git cat-file blob -- <spec>, which never falls back to a revision/path query. Normal-file bytes, binary/preview encoding, the 10 MiBTOO_LARGE_BLOBbound, and WSL read routing (cat-fileis already classified read-only) are unchanged.Older Git versions report only
fatal: Not a valid object name <spec>for a missing path. Only in that exact case, a literalls-files --stage -z/ls-tree -zprobe runs. An empty successful listing proves absence. Corrupt objects, unknown refs, and failed probes are still reported as failed reads, not as absence.Validation
blob-absence-real-git.test.ts: a bracket-named file in untracked, staged, and committed states gets an empty baseline fromgetDiff/getCommitDiff. It fails against the previousgit showreader.pnpm test src/main/gitplus the related runtime/provider diff tests pass (352 files).pnpm check:changed --maxWorkers=2passes (22/22).