libgit2

git_repository_lookup

Version:

Lookup a reference to one of the objects in the repostory.

The generated reference is owned by the repository and should not be freed by the user.

The 'type' parameter must match the type of the object in the odb; the method will fail otherwise. The special value 'GIT_OBJ_ANY' may be passed to let the method guess the object's type.

Signature

int git_repository_lookup(git_object **object, git_repository *repo, const git_oid *id, git_otype type);

Parameters

In
object

pointer to the looked-up object

In
repo

the repository to look up the object

In
id

the unique identifier for the object

In
type

the type of the object

Returns

int

a reference to the object

Versions