UPSTREAM PR #2497: feat!: add hash_kind to TreeRefIter and Data#40
Open
UPSTREAM PR #2497: feat!: add hash_kind to TreeRefIter and Data#40
hash_kind to TreeRefIter and Data#40Conversation
cdbe120 to
78a7ab5
Compare
49231d8 to
bc0a777
Compare
e902b63 to
c6739bc
Compare
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.
Note
Source pull request: GitoxideLabs/gitoxide#2497
This PR is an attempt at making the hash length in
gix_object::tree::ref_iter::decodedepend on the decoded tree’s hash’s size. Previously, it was hardcoded to 20 which is only correct for SHA1, but not for SHA256.There were quite a few follow-up changes as
TreeRef::from_bytesas well asTreeRefIter::from_bytesnow takehash_kindas an argument. Also, sinceTreeRefcan be instantiated inData::decode,Datanow also has to carryhash_kind. Another option that I didn’t explore would have been to addhash_kindas an argument toData::decode.Update 2026-04-04: I changed the initial addition of
hash_lentohash_kind. Tests are now passing, with the exception of the fuzzer having found an issue.