Skip to main content

verify_association

Function verify_association 

Source
pub fn verify_association(bound: &Bound) -> Result<(), String>
Expand description

What: Check that the objects an add was bound to are still where and what they were: the destination and the registration still have the bound identities at their paths, the pointer still has the bound bytes, and the registration still names the pointer. Why: A write into the worktree, or a checkout by Git, must go to the exact worktree the add made; if another process moved or replaced either object, the step stops and the add is reported, with nothing changed.

In TS you’d write (pseudocode):

await verifyAssociation(bound); // throws the first difference