libgit2

git_odb_read_header

Version:

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

The header includes the length and the type of an object.

Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.

Signature

int git_odb_read_header(size_t *len_p, git_otype *type_p, git_odb *db, const git_oid *id);

Parameters

size_t *
In
len_p

pointer where to store the length

In
type_p

pointer where to store the type

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