fix(gitplumb): git-version fallback for cat-file -Z + tests - #26
Merged
Merged
Conversation
Contributor
Change impact: 13,076 ✅ OK
Files to consider for refactoring
|
The -Z (NUL-delimited) protocol needs git >= 2.42; older git exits non-zero on the unknown option, which would silently break every blob() read. GitRepo now probes -Z support once and falls back to the newline protocol when unavailable, so older environments (common LTS distros, self-hosted runners, standalone installs) keep working. The newline-in-filename fix applies wherever -Z is supported; where it is not, behaviour is unchanged from before this series. Adds tests/test_gitplumb.py: a newline-in-filename read (skipped when -Z is unsupported) and a fallback-protocol read. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sagenschneider
force-pushed
the
test-pr18
branch
from
September 17, 2026 15:41
07bf832 to
bdcb97f
Compare
sagenschneider
added a commit
that referenced
this pull request
Sep 17, 2026
0.3.1 was published to PyPI from a commit missing the cat-file -Z version fallback (#26); 0.3.2 releases the corrected main. 0.3.1 should be yanked. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Thanks for the fast review and merges across all six, much appreciated! |
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.
Follow-up hardening on top of #18 (now merged), which switched
blob()tocat-file --batch -Z.-Zrequires git ≥ 2.42 (Aug 2023); on older gitcat-file --batch -Zexits non-zero on the unknown option, the persistent batch process dies on startup, and everyblob()silently returnsNone(verified ondebian:bookworm-slim/ git 2.39: exit 129). Because the Action is a composite action it runs on the runner's git, not the Docker image — soubuntu-22.04runners (git 2.34), self-hosted runners on older LTS, and standalonepip installusers are exposed.GitReponow probes-Zsupport once and falls back to the newline protocol when unavailable: git ≥ 2.42 keeps the newline-in-filename fix from #18, older environments keep working with no regression (the rare newline-in-filename case simply stays unfixed there).Adds
tests/test_gitplumb.py: a newline-in-filenameblob()read (skipped when-Zis unsupported) and a fallback-protocol read.🤖 Generated with Claude Code