Skip to main content

append_op_with_store

Function append_op_with_store 

Source
pub fn append_op_with_store(
    log: &mut dyn OpLog,
    store: &dyn ChunkStore,
    submitter: &str,
    op: ViewOp,
) -> Result<ContentHash, ViewError>
Expand description

append_op, plus the resolution-link check a store makes possible: a head-moving op whose commit the store holds is refused when that commit’s Commit::resolves link is dangling or names a commit with no conflict to resolve.

This is admission policy, not part of the pure fold — the same split as the node’s scope and provenance checks: View::apply stays a store-free function so replicas can replay a log with no store at hand, and every op admitted here still replays cleanly through it. A commit the store cannot supply is skipped, not refused: refs on the git-compat path carry git oids that never enter the chunk store (invariant 2), and a resolves link cannot exist on a commit that cannot be loaded.

§Errors

ViewError::Resolution for an invalid link, plus everything append_op returns.