Tagged Git object ID for a commit SHA string.
(
algorithm: GitHashAlgorithm,
sha: &str,
)
| 1729 | |
| 1730 | /// Tagged Git object ID for a commit SHA string. |
| 1731 | pub(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. |
| 1741 | pub(crate) fn git_algorithm_for_sha(sha: &str) -> CliResult<GitHashAlgorithm> { |
no test coverage detected