pub fn fetch_repo_vars(dir: &Path) -> HashMap<String, String>
Expand description

Fetch git repository metadata for a given path

If the given path is not a git repository, all the keys will be empty strings.

Arguments

  • dir - The path to the git repository

Returns

A hash map containing the following keys:

  • commit_sha - The long hash of the newest commit
  • commit_sha_short - The short hash of the newest commit
  • commit_date - The date of the newest commit
  • commit_author_name - The name of the author of the newest commit
  • commit_author_email - The email of the author of the newest commit
  • commit_committer_name - The name of the committer of the newest commit
  • commit_committer_email - The email of the committer of the newest commit
  • branch - The current branch of the repository