git_object_peel

Recursively peel an object until an object of the specified type is met.

If the query cannot be satisfied due to the object model, git_error_code.GIT_EINVALIDSPEC will be returned (e.g. trying to peel a blob to a tree).

If you pass git_object_t.GIT_OBJECT_ANY as the target type, then the object will be peeled until the type changes. A tag will be peeled until the referenced object is no longer a tag, and a commit will be peeled to a tree. Any other object type will return git_error_code.GIT_EINVALIDSPEC.

If peeling a tag we discover an object which cannot be peeled to the target type due to the object model, git_error_code.GIT_EPEEL will be returned.

You must free the returned object.

Parameters

peeled libgit2_d.types.git_object**

Pointer to the peeled git_object

object const(libgit2_d.types.git_object)*

The object to be processed

target_type libgit2_d.types.git_object_t

The type of the requested object (a GIT_OBJECT_ value)

Return Value

Type: int

0 on success, git_error_code.GIT_EINVALIDSPEC, git_error_code.GIT_EPEEL, or an error code

Meta