Normalize reference name and check validity.
This will normalize the reference name by removing any leading slash '/' characters and collapsing runs of adjacent slashes between name components into a single slash.
Once normalized, if the reference name is valid, it will be returned in the user allocated buffer.
See git_reference_create_symbolic()
for rules about valid names.
User allocated buffer to store normalized name
Size of buffer_out
Reference name to be checked.
Flags to constrain name validation rules - see the GIT_REF_FORMAT constants above.
0 on success, GIT_EBUFS if buffer is too small, GIT_EINVALIDSPEC or an error code.