The decoded bytes of a content-addressed change (contents, hunks, and hashed metadata) for store-level assertions.
(&self, hash_hex: &str)
| 250 | /// The decoded bytes of a content-addressed change (contents, hunks, and |
| 251 | /// hashed metadata) for store-level assertions. |
| 252 | fn change_bytes(&self, hash_hex: &str) -> Vec<u8> { |
| 253 | use atomic_core::types::Base32; |
| 254 | let repository = |
| 255 | atomic_repository::Repository::open_readonly(self.root()).expect("open repository"); |
| 256 | let hash = atomic_core::types::Hash::from_base32(hash_hex.as_bytes()).expect("change hash"); |
| 257 | let change = repository.load_change(&hash).expect("load change"); |
| 258 | let mut bytes = change.contents.clone(); |
| 259 | bytes.extend_from_slice(&change.hashed.metadata); |
| 260 | for operation in change.hunks() { |
| 261 | bytes.extend(format!("{operation:?}").into_bytes()); |
| 262 | } |
| 263 | bytes |
| 264 | } |
| 265 | |
| 266 | /// Capture pending-edit evidence (`atomic status` through the Reconcile |
| 267 | /// boundary). |
no test coverage detected