-
Notifications
You must be signed in to change notification settings - Fork 899
Introduce ObjectDatabase.Write(Stream...) #1518
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
Conversation
LibGit2Sharp/ObjectDatabase.cs
Outdated
@@ -187,6 +187,45 @@ public int Provider(IntPtr content, int max_length, IntPtr data) | |||
return Proxy.git_odb_write(handle, data, GitObject.TypeToKindMap[typeof(T)]); | |||
} | |||
|
|||
/// <summary> | |||
/// Write an object to the object database |
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.
Nitpick, but this should be "Writes" instead of "Write" to be consistent with other comments.
Also, all of these should have a period at the end.
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.
To be fair, it's not that consistent, seeing as I copied and pasted the documentation from the other Write
method above it. 😝
Updated them both, in any case.
If we're fixing the API, we should make the This API comes from when we had the scatter-gather pull mechanism in libgit2 for writing to the objectdb. We kept the API for compat when we let you push data into libgit2, but any new code should ideally not use that. |
Why would we return a |
Right, I understand what you're saying now, @carlosmn: instead of taking a I think that moving towards that API might make sense. At the moment, though, this API matches our existing APIs and unblocks some scenarios. |
5a7243d
to
f324390
Compare
Update the method documentation for `ObjectDatabase.Write` to be consistent with the other methods.
Test that we can `ObjectDatabase.Write` a blob.
Provide a mechanism to write a stream directly to an object database.
f324390
to
1abf368
Compare
Introduce ObjectDatabase.Write(Stream...)
Introduce ObjectDatabase.Write(Stream...) to write directly to the object database (without creating the subsequent
Blob
) and without having to load the entire blob into memory. See #1515