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.
Pointer to the abbreviated reference name. Owned by ref_, do not free.
A reference object, ideally pointing to a branch
0 on success; GIT_EINVALID if the reference isn't either a local or remote branch, otherwise an error code.
See Implementation
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.