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:186–198  ·  view source on GitHub ↗
(repository_root_path: &str)

Source from the content-addressed store, hash-verified

184}
185
186fn get_commit_hash_default_impl(repository_root_path: &str) -> Result<String> {
187 let repo = Repository::open(repository_root_path).context(format!(
188 "Failed to open repository at path: {repository_root_path}"
189 ))?;
190
191 let commit_hash = repo
192 .head()
193 .and_then(|head| head.peel_to_commit())
194 .context("Failed to get HEAD commit")?
195 .id()
196 .to_string();
197 Ok(commit_hash)
198}
199
200#[cfg(test)]
201mod 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