MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / get_commit_hash_default_impl

Function get_commit_hash_default_impl

src/run_environment/provider.rs:156–168  ·  view source on GitHub ↗
(repository_root_path: &str)

Source from the content-addressed store, hash-verified

154}
155
156fn get_commit_hash_default_impl(repository_root_path: &str) -> Result<String> {
157 let repo = Repository::open(repository_root_path).context(format!(
158 "Failed to open repository at path: {repository_root_path}"
159 ))?;
160
161 let commit_hash = repo
162 .head()
163 .and_then(|head| head.peel_to_commit())
164 .context("Failed to get HEAD commit")?
165 .id()
166 .to_string();
167 Ok(commit_hash)
168}
169
170#[cfg(test)]
171mod tests {

Callers 2

get_commit_hashMethod · 0.85
test_get_commit_hashFunction · 0.85

Calls 1

idMethod · 0.80

Tested by 1

test_get_commit_hashFunction · 0.68