MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / git_algorithm_for_sha

Function git_algorithm_for_sha

atomic-cli/src/commands/git/parallel.rs:1741–1749  ·  view source on GitHub ↗

The tagged Git hash algorithm for a commit SHA, by digest width.

(sha: &str)

Source from the content-addressed store, hash-verified

1739
1740/// The tagged Git hash algorithm for a commit SHA, by digest width.
1741pub(crate) fn git_algorithm_for_sha(sha: &str) -> CliResult<GitHashAlgorithm> {
1742 match sha.len() {
1743 40 => Ok(GitHashAlgorithm::Sha1),
1744 64 => Ok(GitHashAlgorithm::Sha256),
1745 other => Err(git_error(format!(
1746 "cannot classify Git hash algorithm for {other}-character SHA '{sha}'"
1747 ))),
1748 }
1749}
1750
1751/// Explicit Git closure boundaries for one import (CB-9A §7).
1752///

Callers 8

compileMethod · 0.85
foreign_commit_factsFunction · 0.85
verified_binding_forMethod · 0.85
rewrite_evidence_forMethod · 0.85
parse_diff_filesFunction · 0.85

Calls 2

git_errorFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected