(fm: &Map<String, Value>, body: &str)
| 31 | Ok(()) |
| 32 | } |
| 33 | fn source_hash(fm: &Map<String, Value>, body: &str) -> String { |
| 34 | let mut h = blake3::Hasher::new(); |
| 35 | h.update(serde_json::to_string(fm).unwrap().as_bytes()); |
| 36 | h.update(b"\0"); |
| 37 | h.update(body.as_bytes()); |
| 38 | format!("blake3:{}", h.finalize().to_hex()) |
| 39 | } |
| 40 | pub fn create(binary: &Path, root: &Path, config: &Path) -> Result<Fixture> { |
| 41 | let mut repo = Repository::init(root)?; |
| 42 | let working_copy = repo.require_working_copy_id()?; |