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

Function effect_lease_matches_oid

atomic-core/src/operation/mod.rs:713–719  ·  view source on GitHub ↗

Whether a Git-ref effect lease value equals the parsed OID (an all-zero OID matches the absent lease, matching Git's zero-OID ref conventions).

(value: &EffectValue, oid: &GitObjectId)

Source from the content-addressed store, hash-verified

711/// Whether a Git-ref effect lease value equals the parsed OID (an all-zero
712/// OID matches the absent lease, matching Git's zero-OID ref conventions).
713pub fn effect_lease_matches_oid(value: &EffectValue, oid: &GitObjectId) -> bool {
714 match value {
715 EffectValue::GitRef(GitRefTarget::Direct(target)) => target == oid,
716 EffectValue::Absent => oid.as_bytes().iter().all(|byte| *byte == 0),
717 _ => false,
718 }
719}
720
721/// One immutable Git-reference observation, sorted by ref name in an operation.
722#[derive(Debug, Clone, PartialEq, Eq)]

Calls 3

allMethod · 0.45
iterMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected