forked from go-git/go-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Merge v6-transport, fix upload-requests atomic logic, and update tests #2
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
Merged
onee-only
merged 66 commits into
onee-only:v6-transport-expose-test
from
aymanbagabas:v6-transport-fix-tests
Jun 10, 2025
Merged
Merge v6-transport, fix upload-requests atomic logic, and update tests #2
onee-only
merged 66 commits into
onee-only:v6-transport-expose-test
from
aymanbagabas:v6-transport-fix-tests
Jun 10, 2025
Conversation
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
this commit removes InitWithOptions by collapsing it back into Init(storage, opt...) NOTE: this is a breaking change for the syntax of calling Init as the type of the second option has changed and instead of calling Init(storage, worktree) we now call Init(storage, WithWorkTree(worktree))
…ovements Minor improvements to transport tests
remove references to NoMatchingRefSpecError, update error value returned from doCalculateRefs, update remote_test to test against the new error retain ref info in remote ref not found error, simplify test fetch error check
git: remote, replace NoMatchingRefSpecError with ErrRemoteRefNotFound, Fixes go-git#1480
…tion Add sparse reset directory validation and remove ResetSparsely.
Co-authored-by: Paulo Gomes <[email protected]> Co-authored-by: Copilot <[email protected]>
Co-authored-by: Paulo Gomes <[email protected]>
This small change makes the backend more idiomatic by removing `BackendOptions` and making `Backend` implement the [http.Handler] interface directly. The loader is now part of the `Backend` struct.
…status-tests [V6] Add some report-status and send-pack tests
[v6] backend: http, make backend more idiomatic
…ions repository: adopt variadic options pattern for Init and PlainInit
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
The support for SHA256 will require the mapping between ObjectFormat and the correct hash.Hash to be used. Signed-off-by: Paulo Gomes <[email protected]>
The introduction of both new types are a stepping stone to enable SHA256 support concurrently - without the need for a build tag. ImmutableHash provides a way to represent varied sized hashes (for SHA1 or SHA256) with a single type, while keeping similar performance of the existing plumbing.Hash. The names were picked in order to provide a clearer distinction on what they do. ImmutableHash is the result of a hash operation and can't be changed once calculated. ObjectHasher, adds the Git object header before a normal hash operation that hash.Hash or plumbing/hash.Hash do. The performance results shows that SHA1 operations could be slower, however for SHA256 it can be over 3 times faster: ~Hasher/hasher-sha1-100B-16 2202226 574.7 ns/op 174.00 MB/s 272 B/op 7 allocs/op ~Hasher/objecthash-sha1-100B-16 1511851 772.6 ns/op 129.43 MB/s 272 B/op 9 allocs/op ~Hasher/objecthash-sha256-100B-16 5057584 247.4 ns/op 404.21 MB/s 96 B/op 7 allocs/op ~Hasher/hasher-sha1-5000B-16 96476 12523 ns/op 399.25 MB/s 5536 B/op 7 allocs/op ~Hasher/objecthash-sha1-5000B-16 105376 10983 ns/op 455.27 MB/s 272 B/op 9 allocs/op ~Hasher/objecthash-sha256-5000B-16 420741 2828 ns/op 1767.77 MB/s 96 B/op 7 allocs/op ~HashFromHex/hasher-parse-sha1-valid-16 23243548 64.65 ns/op 618.69 MB/s 48 B/op 1 allocs/op ~HashFromHex/objecthash-fromhex-sha1-valid-16 18120699 79.62 ns/op 502.36 MB/s 72 B/op 2 allocs/op ~HashFromHex/objecthash-fromhex-sha256-valid-16 8969871 124.2 ns/op 515.22 MB/s 96 B/op 2 allocs/op Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
ObjectID differs from the previous Hash as it has a new format field. For the purposes for equality checking, both values 'sha1' and '' should be perceived as the same, so to avoid cases where the equality check is not being done internally, the value 'sha1' is no longer used. The field format should only be populated when its value is 'sha256'. Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
This commit changes the ObjectFormat type from a string to an int. This would make a default ObjectFormat declaration default to SHA1. A string function is defined to return the string representation of the ObjectFormat.
This combines the ObjectHasher implementation to be hash function agnostic. The SHA1 and SHA256 implementations are now combined into a single implementation that uses the given format to determine the hash function to use.
Signed-off-by: Paulo Gomes <[email protected]>
Users can opt-out of sha1cd by adding an empty import for the upstream implementation: _ "crypto/sha1" Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
*: Initial support for opening sha256 repositories using `ObjectID`
…tree Co-authored-by: Anshul Khandelwal <[email protected]> Co-authored-by: Daan Schoone <[email protected]> Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
[v6-transport] Remove go-git-fixtures@v4 dependency.
add missing packfile in tests
4f6c4b0
to
585d900
Compare
3fe598a
into
onee-only:v6-transport-expose-test
13 of 14 checks passed
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.
No description provided.