git_branch_name

Get the branch name

Given a reference object, this will check that it really is a branch (ie. it lives under "refs/heads/" or "refs/remotes/"), and return the branch part of it.

extern (C) nothrow @nogc
int
git_branch_name
(
const(char)** out_
,)

Parameters

out_ const(char)**

Pointer to the abbreviated reference name. Owned by ref_, do not free.

ref_ const(libgit2_d.types.git_reference)*

A reference object, ideally pointing to a branch

Return Value

Type: int

0 on success; GIT_EINVALID if the reference isn't either a local or remote branch, otherwise an error code.

Meta