libgit2

git_commit_lookup_prefix

Version:

Lookup a commit object from a repository, given a prefix of its identifier (short id).

The returned object should be released with git_commit_free when no longer needed.

See

Signature

int git_commit_lookup_prefix(git_commit **commit, git_repository *repo, const git_oid *id, size_t len);

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.

size_t
In
len

the length of the short identifier

Returns

int

0 or an error code

Versions