private GlobTask(string packageName, IEnumerable <string> includePatterns, IEnumerable <string> excludePatterns) { PackageName = packageName; includePatterns = includePatterns.Distinct().Where(x => !string.IsNullOrWhiteSpace(x)); excludePatterns = excludePatterns.Distinct().Where(x => !string.IsNullOrWhiteSpace(x)); Globs = includePatterns.Select(x => new GlobWrapper(x, true)).Concat( excludePatterns.Select(x => new GlobWrapper(x, false))).ToList(); Globs.Sort(); }