libgit2

git_reference_shorthand

Version:

Get the reference's short name

This will transform the reference name into a name "human-readable" version. If no shortname is appropriate, it will return the full name.

The memory is owned by the reference and must not be freed.

Signature

const char *git_reference_shorthand(const git_reference *ref);

Parameters

In
ref

a reference

Returns

const char *

the human-readable version of the name

Versions