libgit2

git_revparse_single

Version:

Find a single object, as specified by a revision string.

See man gitrevisions, or http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for information on the syntax accepted.

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

Signature

int git_revparse_single(git_object **out, git_repository *repo, const char *spec);

Parameters

In
out

pointer to output object

In
repo

the repository to search in

const char *
In
spec

the textual specification for an object

Returns

int

0 on success, GIT_ENOTFOUND, GIT_EAMBIGUOUS, GIT_EINVALIDSPEC or an error code

Versions