Expand description
Refspec parsing and validation — a port of git/refspec.c.
A refspec describes how references map between a local and a remote
repository. It has the general form [+|^]<src>[:<dst>]. This module
parses a single refspec string and validates it according to the same rules
as Git’s parse_refspec(), distinguishing fetch refspecs from push
refspecs (the two have slightly different validity rules).
The primary entry points are parse_fetch_refspec and
parse_push_refspec, which return RefspecItem on success or
RefspecError::Invalid when the refspec is malformed. Callers that only
care about validity (for example loading remote.<name>.fetch /
remote.<name>.push config) can use valid_fetch_refspec and
valid_push_refspec.
Structs§
- Refspec
Item - A parsed refspec item.
Enums§
- Refspec
Error - Error returned when a refspec cannot be parsed.
Functions§
- parse_
fetch_ refspec - Parse a fetch refspec, returning the parsed item or an error.
- parse_
push_ refspec - Parse a push refspec, returning the parsed item or an error.
- valid_
fetch_ refspec - Returns
truewhenrefspecis a valid fetch refspec. - valid_
push_ refspec - Returns
truewhenrefspecis a valid push refspec.