| 552 | } |
| 553 | |
| 554 | fn walk_files(&self, prefix: &str) -> Result<Vec<String>, Self::Error> { |
| 555 | let files = self.files.borrow(); |
| 556 | let mut result: Vec<String> = files |
| 557 | .iter() |
| 558 | .filter(|(path, file)| { |
| 559 | // Only include files, not directories |
| 560 | if file.metadata.is_dir { |
| 561 | return false; |
| 562 | } |
| 563 | // Skip .atomic directory |
| 564 | if path.starts_with(".atomic/") || *path == ".atomic" { |
| 565 | return false; |
| 566 | } |
| 567 | // Filter by prefix if provided |
| 568 | if prefix.is_empty() { |
| 569 | true |
| 570 | } else if prefix.ends_with('/') { |
| 571 | path.starts_with(prefix) |
| 572 | } else { |
| 573 | path.starts_with(&format!("{}/", prefix)) || *path == prefix |
| 574 | } |
| 575 | }) |
| 576 | .map(|(path, _)| path.clone()) |
| 577 | .collect(); |
| 578 | result.sort(); |
| 579 | Ok(result) |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | impl WorkingCopy for Memory { |