libgit2

git_odb_write

Version:

Write an object directly into the ODB

This method writes a full object straight into the ODB. For most cases, it is preferred to write objects through a write stream, which is both faster and less memory intensive, specially for big objects.

This method is provided for compatibility with custom backends which are not able to support streaming writes

Signature

int git_odb_write(git_oid *oid, git_odb *odb, const void *data, size_t len, git_otype type);

Parameters

In
oid

pointer to store the OID result of the write

In
odb

object database where to store the object

const void *
In
data

buffer with the data to storr

size_t
In
len

size of the buffer

In
type

type of the data to store

Returns

int

GIT_SUCCESS or an error code

Versions