libgit2

git_odb_read_header

Version:

Read the header of an object from the database, without reading its full contents.

Only the 'type' and 'len' fields of the git_rawobj structure are filled. The 'data' pointer will always be NULL.

The raw object pointed by 'out' doesn't need to be manually closed with git_rawobj_close().

Signature

int git_odb_read_header(git_rawobj *out, git_odb *db, const git_oid *id);

Parameters

In
out

object descriptor to populate upon reading.

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