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.
Proposed changes
Read() from a stream could obtain fewer characters than requested, the number of chars read was never checked.
This is a warning with .net9 and a potential issue in current master.
With this change all bytes reported to be in the stream are read, which should be the case anyway.
ReadExactly () was added in .net7. (I considered using that when optimizing the read of revisions for 4.x (that was for .net6, just testing an update.) If Git reported number of bytes for a commit the handling was slower than the current handling that searches for \0 in the stream).
Alternatives to this change:
Test methodology
code review - cannot provoke the error
Merge strategy
I agree that the maintainer squash merge this PR (if the commit message is clear).
✒️ I contribute this code under The Developer Certificate of Origin.