(
&mut self,
state: &WorkingCopyStateRef,
)
| 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)?; |
no test coverage detected