(oid: &git2::Oid)
| 446 | } |
| 447 | |
| 448 | fn object_format_for(oid: &git2::Oid) -> Result<GitObjectFormat, ShimAnchorError> { |
| 449 | match oid.as_bytes().len() { |
| 450 | 20 => Ok(GitObjectFormat::Sha1), |
| 451 | 32 => Ok(GitObjectFormat::Sha256), |
| 452 | other => Err(ShimAnchorError::Git(format!( |
| 453 | "unexpected Git OID width {other}" |
| 454 | ))), |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | fn tagged_oid(oid: &git2::Oid) -> Result<GitOid, ShimAnchorError> { |
| 459 | let bytes = oid.as_bytes(); |
no test coverage detected