Skip to content

Commit 9e17985

Browse files
committed
Support folder membership exceptions in synchronized groups
1 parent 61bd6be commit 9e17985

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

Sources/DependencyCalculator/DependencyGraph.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,16 @@ extension WorkspaceInfo {
458458
let recursiveChildrenFilePaths = ((try? folderPath.recursiveChildren()) ?? [])
459459
.filter { $0.isFile }
460460

461-
paths.append(contentsOf: recursiveChildrenFilePaths.filter { !membershipExceptionPaths.contains($0) })
461+
paths.append(contentsOf: recursiveChildrenFilePaths.filter { filePath in
462+
!membershipExceptionPaths.contains { filePath.isDescendantOrSelf(of: $0) }
463+
})
462464
}
463465
return paths
464466
}
465467
}
468+
469+
private extension Path {
470+
func isDescendantOrSelf(of path: Path) -> Bool {
471+
self == path || string.hasPrefix(path.string + Path.separator)
472+
}
473+
}

0 commit comments

Comments
 (0)