Skip to content

Commit

Permalink
Back-compat workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ladipro committed Mar 3, 2021
1 parent da01245 commit c5afa7c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/Shared/FileMatcher.cs
Expand Up @@ -1063,8 +1063,24 @@ struct RecursionState
{
return Enumerable.Empty<string>();
}

// Back-compat hack: We don't use case-insensitive file enumeration I/O on Linux so the behavior is different depending
// on the NeedsToProcessEachFile flag. If the flag is false and matching is done within the _getFileSystemEntries call,
// it is case sensitive. If the flag is true and matching is handled with MatchFileRecursionStep, it is case-insensitive.
// TODO: Can we fix this by using case-insensitive file I/O on Linux?
string filespec;
if (NativeMethodsShared.IsLinux && recursionState.SearchData.DirectoryPattern != null)
{
filespec = "*.*";
stepResult.NeedsToProcessEachFile = true;
}
else
{
filespec = recursionState.SearchData.Filespec;
}

IEnumerable<string> files = _getFileSystemEntries(FileSystemEntity.Files, recursionState.BaseDirectory,
recursionState.SearchData.Filespec, projectDirectory, stripProjectDirectory);
filespec, projectDirectory, stripProjectDirectory);

if (!stepResult.NeedsToProcessEachFile)
{
Expand Down

0 comments on commit c5afa7c

Please sign in to comment.