Skip to main content

normalize_commit_date_override

Function normalize_commit_date_override 

Source
pub fn normalize_commit_date_override(
    raw: &str,
) -> Result<String, DateParseError>
Expand description

Normalise a user-supplied author/committer date (CLI --date, env overrides) into Git’s stored <epoch> <±HHMM> form.

Canonical raw timestamps pass through unchanged. Other strings are parsed with the same rules as Git’s parse_date (invalid zone tokens such as garbage become +0000, matching git commit --date).

§Errors

Returns DateParseError when the string cannot be interpreted as any date Git accepts.