Skip to content

gitindex: report cat-file process failures - #1161

Open
keegancsmith wants to merge 1 commit into
mainfrom
k/cat-file-error-reporting
Open

gitindex: report cat-file process failures#1161
keegancsmith wants to merge 1 commit into
mainfrom
k/cat-file-error-reporting

Conversation

@keegancsmith

Copy link
Copy Markdown
Member

catfileReader currently treats a closed stdout pipe as ordinary EOF, losing the exit status and stderr when git cat-file fails.

Capture stderr and wait for the process when a stream read reaches EOF. If Git exited unsuccessfully, return its wrapped exit error and diagnostics; otherwise preserve normal EOF behavior. sync.Once lets EOF handling and Close safely share the single process wait.

This intentionally adds no fallback behavior; unsupported --filter is already handled by the capability probe added in #1094.

Premature stdout EOFs currently lose the child exit status and stderr, making batch-reader failures look like ordinary EOF. Preserve those diagnostics while leaving fallback policy unchanged.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a06b86-7fd2-72fb-87a7-4cc8658d3db4
@keegancsmith
keegancsmith requested review from a team and stefanhengl September 4, 2026 11:15

Copy link
Copy Markdown
Member Author

@clemlesne GitHub would not let me request your review as an outside contributor, but since you originally implemented catfileReader in #1021, I would appreciate your thoughts on this process-lifecycle hardening if you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant