| 225 | /// Deterministic recursive listing of a directory tree. |
| 226 | #[allow(dead_code)] |
| 227 | fn walkdir_all(root: &Path) -> Vec<PathBuf> { |
| 228 | let mut out = Vec::new(); |
| 229 | let stack = vec![root.to_path_buf()]; |
| 230 | let mut queue = std::collections::VecDeque::from(stack); |
| 231 | while let Some(dir) = queue.pop_front() { |
| 232 | let Ok(read) = fs::read_dir(&dir) else { |
| 233 | continue; |
| 234 | }; |
| 235 | let mut children: Vec<PathBuf> = read |
| 236 | .filter_map(|entry| entry.ok()) |
| 237 | .map(|entry| entry.path()) |
| 238 | .collect(); |
| 239 | children.sort(); |
| 240 | for child in children { |
| 241 | if child.is_dir() { |
| 242 | queue.push_back(child.clone()); |
| 243 | } |
| 244 | out.push(child); |
| 245 | } |
| 246 | } |
| 247 | out.sort(); |
| 248 | out |
| 249 | } |
| 250 | |
| 251 | /// The CB-9C fidelity corpus: one Git repository whose commit chain walks |
| 252 | /// every supported tree representation. Each commit's tree is verified |