git_reference_name_to_id

Lookup a reference by name and resolve immediately to OID.

This function provides a quick way to resolve a reference name straight through to the object id that it refers to. This avoids having to allocate or free any git_reference objects for simple situations.

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

extern (C) nothrow @nogc
int
git_reference_name_to_id

Parameters

out_ libgit2_d.oid.git_oid*

Pointer to oid to be filled in

repo libgit2_d.types.git_repository*

The repository in which 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