dev/aratiu/sha256 transport fixtures#2656
Merged
Sebastian Thiel (Byron) merged 5 commits intoJun 20, 2026
Merged
Conversation
Add a sha256 analog of the existing `from_bytes` capability test,
asserting that gix-transport's capability parser reads a server
`object-format=sha256` advertisement as sha256:
supports("sha256") is true, and supports("sha1") is false for this
capability, the negative control mirroring the existing sha1 test.
No production change is needed: the parser is generic over the
advertised value, so this just verifies the transport layer passes
sha256 through.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Adrian Ratiu <[email protected]>
Add a daemon-transport handshake test backed by a minimal v2 fixture that advertises `object-format=sha256`. It asserts the handshake reports protocol v2, defers refs to a later ls-refs trip and surfaces the sha256 object-format capability. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Adrian Ratiu <[email protected]>
Add an http handshake test backed by `v2/http-handshake-sha256.response` (modeled on the existing sha1 `v2/http-handshake.response`, with an `object-format=sha256` capability and Content-Length adjusted to match). It asserts the handshake reports protocol v2, returns no refs (deferred to ls-refs) and surfaces the sha256 object-format. Verified on both the reqwest and curl http backends. No production change is required: the http transport relays the server sha256 negotiation untouched. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Adrian Ratiu <[email protected]>
The .response and .request fixtures are byte-exact protocol captures: CRLF HTTP headers, pkt-line length prefixes and a Content-Length that must match the body. Git line-ending conversion (e.g. core.autocrlf) could rewrite them on checkout, making the byte-exact tests platform dependent or fail unexpectedly, so mark the whole fixtures directory "-text" so the on-disk bytes stay stable across environments, matching the existing gix-protocol/tests/fixtures policy. Co-Authored-By: Claude Opus 4.8 <[email protected]> Signed-off-by: Adrian Ratiu <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds SHA-256 object-format negotiation fixtures and tests to ensure gix-transport surfaces the server-advertised object-format=sha256 capability during protocol v2 handshakes (both daemon/TCP-style and HTTP).
Changes:
- Add pkt-line and HTTP handshake fixtures that advertise
object-format=sha256. - Add client tests verifying the V2 handshake returns
object-format=sha256in parsed capabilities. - Add a
.gitattributesrule to prevent line-ending conversions in byte-exact protocol fixtures.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gix-transport/tests/fixtures/v2/http-handshake-sha256.response | New HTTP handshake fixture including object-format=sha256. |
| gix-transport/tests/fixtures/v2/handshake-sha256.response | New V2 handshake pkt-line fixture including object-format=sha256. |
| gix-transport/tests/fixtures/.gitattributes | Ensures fixtures remain byte-exact by disabling text conversions. |
| gix-transport/tests/client/git.rs | Adds a V2 handshake test asserting object-format=sha256 is surfaced. |
| gix-transport/tests/client/capabilities.rs | Adds a unit test validating parsing/support checks for object-format=sha256. |
| gix-transport/tests/client/blocking_io/http/mod.rs | Adds an HTTP handshake test asserting object-format=sha256 is surfaced. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
While it's more correct to test for `values()` of a capability, I found it much more complex to read so reverted this to only look at `value()`. Once options with multiple values are under test, we can of course test for that, assuming that no bug is introduced that would somehow add values on its own. Co-authored-by: Sebastian Thiel <[email protected]>
Sebastian Thiel (Byron)
force-pushed
the
dev/aratiu/sha256-transport-fixtures
branch
from
June 20, 2026 03:16
c1f90c2 to
d056a3f
Compare
Sebastian Thiel (Byron)
enabled auto-merge
June 20, 2026 03:28
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.
This is PR #2647 with one commit added on top.
No revwrites, but can't push back there.