(
&self,
path: &str,
content: &[u8],
)
| 195 | } |
| 196 | |
| 197 | fn execute_file( |
| 198 | &self, |
| 199 | path: &str, |
| 200 | content: &[u8], |
| 201 | ) -> Result<super::operation::PendingFilesystemEffect, RepositoryError> { |
| 202 | let content_hash = Hash::of(content); |
| 203 | let effect = self |
| 204 | .effect_for_expected_new(path, |value| { |
| 205 | matches!( |
| 206 | value, |
| 207 | EffectValue::File(state) |
| 208 | if state.kind != FileKind::Directory && state.content == content_hash |
| 209 | ) |
| 210 | }) |
| 211 | .ok_or_else(|| RepositoryError::InvalidOperation { |
| 212 | message: format!("switch operation omitted file lease for '{path}'"), |
| 213 | })?; |
| 214 | self.execute_effect(effect, Some(content)) |
| 215 | } |
| 216 | |
| 217 | fn record( |
| 218 | &self, |
no test coverage detected