Skip to main content

parse_person

Function parse_person 

Source
pub fn parse_person(value: &[u8]) -> Result<Person, GitParseError>
Expand description

Parse a person-line VALUE (the bytes after author etc.).

Tolerances, per SPEC-GIT-IMPORT §3.2:

  • identity = bytes through the closing > of the last <...> group, verbatim (interior malformations preserved);
  • bracket-less lines: identity = remainder with one trailing ␣<decimal>␣[+-]NNNN match stripped;
  • timestamp = first whitespace-separated decimal (optionally --signed) after the identity; missing → error (commits/tags need one);
  • timezone = the following token when it looks like [+-]NNNN.