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

Method put_working_copy_state

atomic-core/src/operation/codec.rs:565–585  ·  view source on GitHub ↗
(
        &mut self,
        state: &WorkingCopyStateRef,
    )

Source from the content-addressed store, hash-verified

563 }
564
565 fn put_working_copy_state(
566 &mut self,
567 state: &WorkingCopyStateRef,
568 ) -> Result<(), OperationCodecError> {
569 if state.desired_view == 0 {
570 return Err(OperationCodecError::new(
571 "working-copy desired view must be non-zero",
572 ));
573 }
574 if state.materialized_manifest.is_some() && state.materialized_state.is_none() {
575 return Err(OperationCodecError::new(
576 "working-copy materialized manifest requires materialized state",
577 ));
578 }
579 self.put_working_copy(state.id)?;
580 self.put_hash(state.location_fingerprint)?;
581 self.put_u64(state.desired_view)?;
582 self.put_hash(state.desired_state)?;
583 self.put_optional_hash(state.materialized_state)?;
584 self.put_optional_hash(state.materialized_manifest)
585 }
586
587 fn put_git_state(&mut self, state: &GitStateRef) -> Result<(), OperationCodecError> {
588 self.put_git_head(&state.head)?;

Callers 2

put_repo_stateMethod · 0.80
put_effect_valueMethod · 0.80

Calls 5

is_noneMethod · 0.80
put_hashMethod · 0.80
put_u64Method · 0.80
put_optional_hashMethod · 0.80
put_working_copyMethod · 0.45

Tested by

no test coverage detected