-
Notifications
You must be signed in to change notification settings - Fork 133
Add support for Git objectformat extension and SHA256 repositories #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/10.0.2xx
Are you sure you want to change the base?
Add support for Git objectformat extension and SHA256 repositories #1477
Conversation
Co-authored-by: tmat <[email protected]>
Can you add SHA-256 variants of the tests that currently hardcode fake SHA-1 hashes? In GitReferenceResolverTests for example. Just to verify that the longer hashes don't get rejected by any file format validation. |
@copilot It's not sufficient to parse the |
…haracters) Co-authored-by: tmat <[email protected]>
Updated the code to accept SHA256 hashes (64 characters) in addition to SHA1 hashes (40 characters). The |
Co-authored-by: tmat <[email protected]>
@copilot ResolveReference_SHA256 is failing. Fix it please |
…acters Co-authored-by: tmat <[email protected]>
Fixed the hash in ResolveReference_SHA256 test - it was 66 characters instead of 64. Corrected to exactly 64 characters for a valid SHA256 hash. See commit that will be pushed. |
Changes Made
Updated IsObjectId method in
GitReferenceResolver.cs
to accept both:Added comprehensive SHA256 tests including:
ResolveReference_SHA256
: Tests SHA256 hash resolutionResolveReference_Packed_SHA256
: Tests packed refs with SHA256 hashesReadPackedReferences_SHA256
: Tests reading packed refs with SHA256Added documentation: Comment explaining that 40 is for SHA1 and 64 is for SHA256
Fixed test: Corrected SHA256 hash in ResolveReference_SHA256 test to be exactly 64 characters
This ensures that SourceLink can work with both traditional SHA1 repositories and modern SHA256 repositories.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.