Skip to content

Commit

Permalink
Back-compat workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ladipro committed Feb 16, 2021
1 parent ae4a58a commit 8bb636c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/Shared/FileMatcher.cs
Expand Up @@ -1061,10 +1061,27 @@ 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?
bool forceFileProcessing = false;
string filespec;
if (NativeMethodsShared.IsLinux && recursionState.SearchData.DirectoryPattern != null)
{
filespec = "*.*";
forceFileProcessing = 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)
if (!forceFileProcessing && !stepResult.NeedsToProcessEachFile)
{
return files;
}
Expand Down

0 comments on commit 8bb636c

Please sign in to comment.