Skip to content

Commit af31633

Browse files
voidpetalsschuberth
authored andcommitted
fix(model): Adhere to omitExcluded for projects in getDependencies()
Previously, `getDependencies(omitExcluded = true)` only filtered excluded packages from results but still traversed all projects. This caused inconsistencies when dependency edges only exist in excluded projects (e.g. test-only submodules). Now excluded projects are also skipped during traversal, ensuring that dependencies which are only reachable through excluded projects are not discovered. Signed-off-by: Kai Hodžić <hodzic.e.k@outlook.com>
1 parent 5ddb211 commit af31633

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

model/src/main/kotlin/OrtResult.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ data class OrtResult(
243243
val dependencies = mutableSetOf<Identifier>()
244244
val matcher = DependencyNavigator.MATCH_ALL.takeUnless { omitExcluded } ?: { !isExcluded(it.id) }
245245

246-
getProjects().forEach { project ->
246+
getProjects(omitExcluded).forEach { project ->
247247
if (project.id == id) {
248248
dependencies += dependencyNavigator.projectDependencies(project, maxLevel, matcher)
249249
}

0 commit comments

Comments
 (0)