Repository navigation
Conversation
This was referenced Oct 28, 2026
Collaborator
Author
|
main already keeps failed blob reads out of the settled diff cache (reusable=!readFailed). Turning those reads into rejections makes the renderer show editable 'Error loading diff' text that can be saved over the working file (#25407 is still open). It also discards a good working-tree side when the other side fails, hard-fails on transient WSL/SSH errors, and adds an ls-tree spawn to every add/delete/untracked diff. All of this is for corrupt-object and EACCES cases that healthy repos never hit. |
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 and behavior
An unreadable working file or Git object currently becomes empty text in a successful diff response. A missing staged blob can look like a complete deletion; a corrupt history object can look like no changes. The existing
failedblob marker only prevented cache retention.Reject these incomplete reads before building or caching a diff. Existing RPC rejection handling can display the error. Proven additions/deletions, unborn branches, root commits, binary previews, and oversized-file fallbacks keep their existing behavior.
Implementation
ls-treelookup. Actual Git can emit its normal “path not in HEAD” message when the HEAD commit object is missing, so that message alone is insufficient proof of absence.Evidence
Real temporary Git repositories exercise the production readers. Deleting a staged blob reproduces the old successful empty-side response; deleting historical blobs reproduces empty comparison content. An unreadable working file is rejected and its bytes remain intact after access is restored. Repairing objects recovers correct diffs without retaining an empty result.
The initial regression against unchanged production failed both assertions, with four valid-addition/deletion/root controls passing. Final coverage also checks each historical reader, missing HEAD objects, binary read failure and unusable host paths.
Validation
pnpm tc: passed. Focused lint and format checks passed. Independent production source review passed; literal bracket/nested path lookup was independently checked on Git 2.25.5.pnpm check:changed --maxWorkers=2 --base=2d3e7e452000c26433650d75422e79a06be80684was attempted. It caught unsupported buffer-option fields, which were removed; the final full typecheck passes. Its broad affected-test selection produced no test results for over ten minutes and was stopped. The aggregate gate is incomplete; no full-green claim. Explicit suites above are the verified runtime evidence.Integration requirement
Keep this draft blocked on the editor rejected-load protection in #25407 before marking it ready. That PR prevents error text from becoming editable working-file content. This patch fixes the backend's false-success responses and does not duplicate that renderer change. It also overlaps the blob-read module touched by #34778; combine its literal-object read with these absence/failure checks and rerun these regressions when resolving the source conflict.
Visual proof
Backend response/error change, with real-Git before/after assertions above; no layout or styling changes. Rendered editable-error integration remains part of #25407.