Atomic-directory manifest: every relative path with its exact bytes. CB-13A R2 uses this to prove shim verify is a read-only diagnostic — the manifest must be byte-identical across a verify invocation, even on a repository whose operation head is still incomplete.
(root: &Path)
| 878 | /// the manifest must be byte-identical across a verify invocation, even on |
| 879 | /// a repository whose operation head is still incomplete. |
| 880 | fn atomic_manifest(root: &Path) -> BTreeMap<String, Vec<u8>> { |
| 881 | fn walk(dir: &Path, prefix: &str, out: &mut BTreeMap<String, Vec<u8>>) { |
| 882 | let Ok(entries) = fs::read_dir(dir) else { |
| 883 | return; |
| 884 | }; |
| 885 | for entry in entries.flatten() { |
| 886 | let path = entry.path(); |
| 887 | let name = format!("{prefix}/{}", entry.file_name().to_string_lossy()); |
| 888 | if path.is_dir() { |
| 889 | walk(&path, &name, out); |
| 890 | } else if let Ok(bytes) = fs::read(&path) { |
| 891 | out.insert(name, bytes); |
| 892 | } |
| 893 | } |
| 894 | } |
| 895 | let mut out = BTreeMap::new(); |
| 896 | walk(&root.join(".atomic"), ".atomic", &mut out); |
| 897 | out |
| 898 | } |
| 899 | |
| 900 | /// CB-13A R2: shim verify is a read-only diagnostic. Around a switch that |
| 901 | /// was interrupted mid-effect (the switch's own error path synchronously |
no test coverage detected