{{ message }}
Repository navigation
indexer: return a valid pack checksum OID - #7427
Open
penielgold-hub wants to merge 1 commit into
Open
penielgold-hub wants to merge 1 commit into
penielgold-hub wants to merge 1 commit into
Conversation
Member
This branch has not been deployed
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.

Summary
Fix
git_indexer_hash()returning an incorrectly represented object ID.The existing implementation casts raw pack checksum bytes directly to
git_oid *. With the currentgit_oidlayout, the first checksum byte is incorrectly interpreted as the OID type.This change:
git_oid, using the indexer's object format.git_indexer_hash().Regression evidence
Before the fix:
pack::indexer::out_of_orderfails.GIT_OID_SHA1(1).222(0xde), the first checksum byte.1.After the fix:
ok 1 - pack::indexer::out_of_order.0.Validation
libgit2_testsusing Visual Studio 2022 MSVC, x64, Debug configuration.mainbase.git diff --checkpassed.The regression test uses the existing SHA-1 pack fixture. SHA-256 compatibility is handled by the format-aware conversion but is not directly covered by this native regression test.
This correction was identified while testing libgit2 integration for rust-lang/git2-rs#1259.