Skip to content

Commit

Permalink
Use is_inside_or_equal_ref in ContextCondition::InPath (vercel/tu…
Browse files Browse the repository at this point in the history
…rborepo#5954)

### Description

vercel/turborepo#5938 (comment)

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes WEB-1570
  • Loading branch information
jridgewell authored Sep 15, 2023
1 parent 5181276 commit cb115eb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/turbopack/src/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ impl ContextCondition {
}
ContextCondition::Not(condition) => condition.matches(path).await.map(|b| !b),
ContextCondition::InPath(other_path) => {
let other_path = &*other_path.await?;
Ok(path == other_path || path.is_inside_ref(other_path))
Ok(path.is_inside_or_equal_ref(&*other_path.await?))
}
ContextCondition::InDirectory(dir) => Ok(path.path.starts_with(&format!("{dir}/"))
|| path.path.contains(&format!("/{dir}/"))
Expand Down

0 comments on commit cb115eb

Please sign in to comment.