Skip to main content

get_head_commit_hash

Function get_head_commit_hash 

Source
pub fn get_head_commit_hash(cwd: &Path) -> Result<Option<String>>
Expand description

Get the HEAD commit hash (short form) for the repository at the given path.

§Arguments

  • cwd - The working directory to run git commands in

§Returns

The short commit hash (7 characters) of HEAD, or None if not in a git repository.