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

Function git_object_id_for_sha

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

Tagged Git object ID for a commit SHA string.

(
    algorithm: GitHashAlgorithm,
    sha: &str,
)

Source from the content-addressed store, hash-verified

1729
1730/// Tagged Git object ID for a commit SHA string.
1731pub(crate) fn git_object_id_for_sha(
1732 algorithm: GitHashAlgorithm,
1733 sha: &str,
1734) -> CliResult<GitObjectId> {
1735 let oid = Oid::from_str(sha)
1736 .map_err(|error| git_error(format!("invalid Git commit SHA '{sha}': {error}")))?;
1737 git_object_id(algorithm, oid)
1738}
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> {

Callers 6

compileMethod · 0.85
foreign_commit_factsFunction · 0.85
verified_binding_forMethod · 0.85

Calls 2

git_errorFunction · 0.70
git_object_idFunction · 0.70

Tested by

no test coverage detected