matchesIgnorePattern function
Returns whether relativePath matches a single gitignore-style pattern.
Implementation
@visibleForTesting
bool matchesIgnorePattern({
required String relativePath,
required String pattern,
}) {
final normalizedPath = normalizeIgnoreRelativePath(relativePath);
final globPatterns = expandIgnorePattern(pattern);
return globPatterns.any(
(globPattern) =>
Glob(globPattern, context: p.posix).matches(normalizedPath),
);
}