Lookup a branch by its name in a repository.
The generated reference must be freed by the user.
The branch name will be checked for validity.
See git_tag_create()
for rules about valid names.
Name of the branch to be looked-up; this name is validated for consistency.
Type of the considered branch. This should be valued with either GIT_BRANCH_LOCAL or GIT_BRANCH_REMOTE.
0 on success; GIT_ENOTFOUND when no matching branch exists, GIT_EINVALIDSPEC, otherwise an error code.