(
root: &Path,
dir: &Path,
worktree_rules: &crate::ignore::IgnoreRules,
workspace_rules: &crate::ignore::IgnoreRules,
out: &mut Vec<String>,
| 1637 | let workspace_rules = IgnoreRules::load(root); |
| 1638 | let mut result = Vec::new(); |
| 1639 | fn walk( |
| 1640 | root: &Path, |
| 1641 | dir: &Path, |
| 1642 | worktree_rules: &crate::ignore::IgnoreRules, |
| 1643 | workspace_rules: &crate::ignore::IgnoreRules, |
| 1644 | out: &mut Vec<String>, |
| 1645 | ) { |
| 1646 | let Ok(entries) = std::fs::read_dir(dir) else { |
| 1647 | return; |
| 1648 | }; |
| 1649 | for entry in entries.flatten() { |
| 1650 | let path = entry.path(); |
| 1651 | let Ok(relative) = path.strip_prefix(root) else { |
| 1652 | continue; |
| 1653 | }; |
| 1654 | let is_directory = path.is_dir(); |
| 1655 | let ignored = worktree_rules.is_ignored(relative, is_directory) |
| 1656 | || workspace_rules.is_ignored(relative, is_directory); |
| 1657 | if ignored { |
| 1658 | if let Some(relative) = relative.to_str() { |
| 1659 | out.push(relative.to_string()); |
| 1660 | } |
| 1661 | } else if is_directory { |
| 1662 | walk(root, &path, worktree_rules, workspace_rules, out); |
| 1663 | } |
| 1664 | } |
| 1665 | } |
| 1666 | walk(root, root, &worktree_rules, &workspace_rules, &mut result); |
| 1667 | result.sort(); |
| 1668 | result |
no test coverage detected