-
Notifications
You must be signed in to change notification settings - Fork 33
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
Wrap lobjs so they can be deduped w/ other IPFS objects, fixes #12 #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 small thing. A test or two would be nice too.
cmd/git-remote-ipld/ipld.go
Outdated
return err | ||
} | ||
|
||
dataHash, err := h.api.Add(bytes.NewReader(data[endOfHeader:])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two adds can run in parallel with sync.waitgroup
(api calls can be slow, but can be heavily parallelized)
8b94056
to
ca3d565
Compare
So I added a Edit: I misspoke, there is a push test, but the large object does not get sent because it's pushing |
Discovered that the push tests were never actually run because there was a missing newline at the end of |
Jenkins is broken in |
Looks like macOS is still failing:
|
This PR fixes #12 by splitting large objects into a header and raw data which are individually hashed then patched together for the lobj hash. I kept a fallback to just adding the entire object if the header can't be found.
I ran it against a repo, one 3.6MB lobj example is:
Not exactly sure how to add tests for this -- any guidance is appreciated.
Edit: tests seem to fail on macOS but I think it's unrelated.