Function hisho_core::git::fetch_repo_vars
source · 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 commitcommit_sha_short
- The short hash of the newest commitcommit_date
- The date of the newest commitcommit_author_name
- The name of the author of the newest commitcommit_author_email
- The email of the author of the newest commitcommit_committer_name
- The name of the committer of the newest commitcommit_committer_email
- The email of the committer of the newest commitbranch
- The current branch of the repository