Export a set of paths from the recorded graph and return the bytes.
(root: &Path, view: &str, paths: &[&str])
| 130 | |
| 131 | /// Export a set of paths from the recorded graph and return the bytes. |
| 132 | fn graph_export(root: &Path, view: &str, paths: &[&str]) -> (Vec<(String, Vec<u8>)>, Duration) { |
| 133 | let repo = open_repo(root); |
| 134 | let start = Instant::now(); |
| 135 | let mut out = Vec::new(); |
| 136 | for path in paths { |
| 137 | let bytes = repo |
| 138 | .get_file_content_on_view(path, view) |
| 139 | .unwrap_or_else(|error| panic!("graph export failed for {path}: {error}")) |
| 140 | .unwrap_or_else(|| panic!("graph export missing {path}")); |
| 141 | out.push((path.to_string(), bytes)); |
| 142 | } |
| 143 | (out, start.elapsed()) |
| 144 | } |
| 145 | |
| 146 | fn assert_export_matches(root: &Path, view: &str, expected: &[(&str, Vec<u8>)], bound: Duration) { |
| 147 | clear_worktree(root); |
no test coverage detected