mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
odb: Prevent stream_finalize_write() from overwriting
Now that #1785 is merged, git_odb_stream_finalize_write() calculates the object id before invoking the odb backend. This commit gives a chance to the backend to check if it already knows this object.
This commit is contained in:
@@ -92,6 +92,10 @@ struct git_odb_stream {
|
||||
/**
|
||||
* Store the contents of the stream as an object with the id
|
||||
* specified in `oid`.
|
||||
*
|
||||
* This method will *not* be invoked by libgit2 if the object pointed at
|
||||
* by `oid` already exists in any backend. Libgit2 will however take care
|
||||
* of properly disposing the stream through a call to `free()`.
|
||||
*/
|
||||
int (*finalize_write)(git_odb_stream *stream, const git_oid *oid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user