libgit2

git_reference_peel

Version:

Recursively peel reference until object of the specified type is found.

The retrieved peeled object is owned by the repository and should be closed with the git_object_free method.

If you pass GIT_OBJECT_ANY as the target type, then the object will be peeled until a non-tag object is met.

Signature

int git_reference_peel(git_object **out, const git_reference *ref, git_object_t type);

Parameters

Out
out

Pointer to the peeled git_object

In
ref

The reference to be processed

In
type

The type of the requested object (GIT_OBJECT_COMMIT, GIT_OBJECT_TAG, GIT_OBJECT_TREE, GIT_OBJECT_BLOB or GIT_OBJECT_ANY).

Returns

int

0 on success, GIT_EAMBIGUOUS, GIT_ENOTFOUND or an error code

Versions