git_repository_head

Retrieve and resolve the reference pointed at by HEAD.

The returned git_reference will be owned by caller and git_reference_free() must be called when done with it to release the allocated memory and prevent a leak.

extern (C) nothrow @nogc
int
git_repository_head

Parameters

out_ libgit2_d.types.git_reference**

pointer to the reference which will be retrieved

repo libgit2_d.types.git_repository*

a repository object

Return Value

Type: int

0 on success, git_error_code.GIT_EUNBORNBRANCH when HEAD points to a non existing branch, git_error_code.GIT_ENOTFOUND when HEAD is missing; an error code otherwise

Meta