Skip to content

Commit

Permalink
linux環境でrootの/の前が空文字としてglob matcherにわたる問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Gs-itisitcat committed Mar 10, 2024
1 parent a65808a commit c60531e
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ public class RecursiveRepositorySearcher : ISearcher
/// <returns><c>true</c> if the directory matches the exclusion criteria; otherwise, <c>false</c>.</returns>
private bool IsMatchExclude(DirectoryInfo directoryInfo)
{
return directoryInfo.FullName.Split(Path.DirectorySeparatorChar).Any(p => _nameMatcher.Match(p).HasMatches)
|| ExcludePaths.Any(p => directoryInfo.FullName.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).Contains(p));
return directoryInfo
.FullName
.Split(Path.DirectorySeparatorChar)
.Where(p => !string.IsNullOrEmpty(p))
.Any(p => _nameMatcher.Match(p).HasMatches)
|| ExcludePaths
.Any(p => directoryInfo
.FullName
.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)
.Contains(p)
);
}

/// <summary>
Expand Down

0 comments on commit c60531e

Please sign in to comment.