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

Method read_working_copy_state

atomic-core/src/operation/codec.rs:1190–1210  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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()?;

Callers 2

read_repo_stateMethod · 0.80
read_effect_valueMethod · 0.80

Calls 5

read_working_copyMethod · 0.80
read_hashMethod · 0.80
read_u64Method · 0.80
read_optional_hashMethod · 0.80
is_noneMethod · 0.80

Tested by

no test coverage detected