| 140 | } |
| 141 | |
| 142 | fn key_file(home: &Path) -> PathBuf { |
| 143 | let mut secret = [0u8; 32]; |
| 144 | for (index, byte) in secret.iter_mut().enumerate() { |
| 145 | *byte = 0x42u8.wrapping_add((index as u8).wrapping_mul(13).wrapping_add(7)); |
| 146 | } |
| 147 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 148 | let path = home.join("cb13d-binding.key"); |
| 149 | fs::write(&path, hex).expect("write binding key"); |
| 150 | path |
| 151 | } |
| 152 | |
| 153 | /// Opt the repository into the optional watch daemon (the shim opt-in |
| 154 | /// itself is recorded by `git shim enable`). The serialized |