(entries: &[IndexEntryObservation])
| 1199 | } |
| 1200 | |
| 1201 | fn digest_index(entries: &[IndexEntryObservation]) -> CanonicalIndexDigest { |
| 1202 | let mut hasher = blake3::Hasher::new(); |
| 1203 | hasher.update(INDEX_DIGEST_DOMAIN); |
| 1204 | hasher.update(&(entries.len() as u64).to_le_bytes()); |
| 1205 | for entry in entries { |
| 1206 | hasher.update(&(entry.path.len() as u64).to_le_bytes()); |
| 1207 | hasher.update(&entry.path); |
| 1208 | hasher.update(&[entry.stage]); |
| 1209 | hasher.update(entry.oid.as_bytes()); |
| 1210 | hasher.update(&entry.mode.to_le_bytes()); |
| 1211 | hasher.update(&entry.flags.to_le_bytes()); |
| 1212 | hasher.update(&entry.flags_extended.to_le_bytes()); |
| 1213 | } |
| 1214 | CanonicalIndexDigest(hasher.finalize().to_hex().to_string()) |
| 1215 | } |
| 1216 | |
| 1217 | fn observe_locks(paths: &GitAdminPaths) -> Result<LockObservation, ObservationError> { |
| 1218 | let index_lock_path = append_suffix(&paths.index_path, ".lock"); |
no test coverage detected