| 87 | } |
| 88 | |
| 89 | fn write_key_file(root: &Path, name: &str, seed: u8) -> PathBuf { |
| 90 | let mut secret = [0u8; 32]; |
| 91 | for (index, byte) in secret.iter_mut().enumerate() { |
| 92 | *byte = seed.wrapping_add((index as u8) * 7 + 11); |
| 93 | } |
| 94 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 95 | let path = root.join(name); |
| 96 | fs::write(&path, hex).expect("write key file"); |
| 97 | path |
| 98 | } |
| 99 | |
| 100 | /// Colocated fixture with two bound commits: `main` at C1 (other.txt v1), |
| 101 | /// where tracked.txt is byte-identical to C0 so a dirty tracked.txt survives |