Merge pull request #19293 from github/redsun82/rust-fix-member-aggregation

Rust: fix workspace member aggregation when absolute path is a glob pattern
This commit is contained in:
Paolo Tranquilli
2025-04-14 12:08:43 +02:00
committed by GitHub
27 changed files with 5 additions and 3 deletions

View File

@@ -173,8 +173,10 @@ impl TomlReader {
}
fn workspace_members_match(workspace_dir: &AbsPath, members: &[String], target: &AbsPath) -> bool {
members.iter().any(|p| {
glob::Pattern::new(workspace_dir.join(p).as_str()).is_ok_and(|p| p.matches(target.as_str()))
target.strip_prefix(workspace_dir).is_some_and(|rel_path| {
members
.iter()
.any(|p| glob::Pattern::new(p).is_ok_and(|p| p.matches(rel_path.as_str())))
})
}