For every leaf file under `dir_rel` in the tree at `sha`, return `(filename, blob bytes)`. Reads are batched against a single repo open; intended for "render this run's reply stream as of commit X". Returns `Ok(vec![])` if the directory doesn't exist at that commit.
(
root: &Path,
sha: &str,
dir_rel: &str,
)
| 282 | /// intended for "render this run's reply stream as of commit X". Returns |
| 283 | /// `Ok(vec![])` if the directory doesn't exist at that commit. |
| 284 | pub fn list_dir_blobs_at( |
| 285 | root: &Path, |
| 286 | sha: &str, |
| 287 | dir_rel: &str, |
| 288 | ) -> Result<Vec<(String, Vec<u8>)>> { |
| 289 | with_subtree_at(root, sha, dir_rel, vec![], |repo, dir_tree| { |
| 290 | let mut out = Vec::with_capacity(dir_tree.len()); |
| 291 | for e in dir_tree.iter() { |
| 292 | let Some(name) = e.name() else { continue }; |
| 293 | let blob = repo.find_blob(e.id())?; |
| 294 | out.push((name.to_string(), blob.content().to_vec())); |
| 295 | } |
| 296 | Ok(out) |
| 297 | }) |
| 298 | } |
| 299 | |
| 300 | /// Walk the tree at `runs/<run_id>/` at `sha` and return per-step committed |
| 301 | /// files as `{step_id: [<file>, ...]}`. Files at `<step>/sub/x.png` flatten |
searching dependent graphs…