A deterministic hex-encoded Ed25519 test key file outside the worktree (RFC §12.5: untracked files break complete equivalence).
(&self)
| 149 | /// A deterministic hex-encoded Ed25519 test key file outside the |
| 150 | /// worktree (RFC §12.5: untracked files break complete equivalence). |
| 151 | fn key(&self) -> std::path::PathBuf { |
| 152 | let mut secret = [0u8; 32]; |
| 153 | for (index, byte) in secret.iter_mut().enumerate() { |
| 154 | *byte = 0x8Au8.wrapping_add((index as u8).wrapping_mul(7).wrapping_add(3)); |
| 155 | } |
| 156 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 157 | let path = self.home.path().join("cb8a-key.hex"); |
| 158 | fs::write(&path, hex).expect("write key file"); |
| 159 | path |
| 160 | } |
| 161 | |
| 162 | /// Anchor the shim (CB-7A) so git-side transitions adopt through the |
| 163 | /// post-checkout hook (needed for ephemeral-view adoption tests). |