git_reference_lookup

Lookup a reference by name in a repository.

The returned reference must be freed by the user.

The name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

extern (C) nothrow @nogc
int
git_reference_lookup

Parameters

out_ libgit2_d.types.git_reference**

pointer to the looked-up reference

repo libgit2_d.types.git_repository*

the repository to look up the reference

name const(char)*

the long name for the reference (e.g. HEAD, refs/heads/master, refs/tags/v0.1.0, ...)

Return Value

Type: int

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

Meta