Lookup a reference by its name in a repository.
The generated reference must be freed by the user.
pointer to the looked-up reference
the repository to look up the reference
the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...)
GIT_SUCCESS or an error code