Skip to main content

head_commit_record

Function head_commit_record 

Source
pub fn head_commit_record(root: &Path) -> Option<CommitRecord>
Expand description

HEAD as a full CommitRecord — abbreviated SHA, author name + email, and the message. Used by the commit-validation family’s HEAD-only mode (since: unset), where rules like git_commit_author_allowlist need the author and the SHA in addition to the message.

Returns None on the same conditions as head_commit_message (no git, not a repo, unborn HEAD), so the rule silently no-ops. Uses the same NUL-separated --format encoding as commit_messages_in_range so a single commit round-trips through the shared commit-log parser.