(&mut self)
| 1188 | } |
| 1189 | |
| 1190 | fn read_working_copy_state(&mut self) -> Result<WorkingCopyStateRef, OperationCodecError> { |
| 1191 | let state = WorkingCopyStateRef { |
| 1192 | id: self.read_working_copy()?, |
| 1193 | location_fingerprint: self.read_hash()?, |
| 1194 | desired_view: self.read_u64()?, |
| 1195 | desired_state: self.read_hash()?, |
| 1196 | materialized_state: self.read_optional_hash("materialized state")?, |
| 1197 | materialized_manifest: self.read_optional_hash("materialized manifest")?, |
| 1198 | }; |
| 1199 | if state.desired_view == 0 { |
| 1200 | return Err(OperationCodecError::new( |
| 1201 | "working-copy desired view must be non-zero", |
| 1202 | )); |
| 1203 | } |
| 1204 | if state.materialized_manifest.is_some() && state.materialized_state.is_none() { |
| 1205 | return Err(OperationCodecError::new( |
| 1206 | "working-copy materialized manifest requires materialized state", |
| 1207 | )); |
| 1208 | } |
| 1209 | Ok(state) |
| 1210 | } |
| 1211 | |
| 1212 | fn read_git_state(&mut self) -> Result<GitStateRef, OperationCodecError> { |
| 1213 | let head = self.read_git_head()?; |
no test coverage detected