libgit2

git_odb_read

Version:

Read an object from the database.

This method queries all avaiable ODB backends trying to read the given OID.

The returned object is reference counted and internally cached, so it should be closed by the user once it's no longer in use.

Signature

int git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id);

Parameters

In
out

pointer where to store the read object

In
db

database to search for the object in.

In
id

identity of the object to read.

Returns

int
  • GIT_SUCCESS if the object was read;
  • GIT_ENOTFOUND if the object is not in the database.

Versions