libgit2

git_commit_lookup

Version:

Lookup a commit object from a repository.

Signature

int git_commit_lookup(git_commit **commit, git_repository *repo, const git_oid *id);

Parameters

In
commit

pointer to the looked up commit

In
repo

the repo to use when locating the commit.

In
id

identity of the commit to locate. If the object is an annotated tag it will be peeled back to the commit.

Returns

int

0 on success; error code otherwise

Versions