git_reference_normalize_name

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_symbolic_create() for rules about valid names.

extern (C) nothrow @nogc
int
git_reference_normalize_name
(,,
const(char)* name
,
uint flags
)

Parameters

buffer_out char*

User allocated buffer to store normalized name

buffer_size size_t

Size of buffer_out

name const(char)*

Reference name to be checked.

flags uint

Flags to constrain name validation rules - see the GIT_REFERENCE_FORMAT constants above.

Return Value

Type: int

0 on success, git_error_code.GIT_EBUFS if buffer is too small, git_error_code.GIT_EINVALIDSPEC or an error code.

Meta