From 38b3c20c5b36f1a821d3f38dfef63f547bb1b918 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Fri, 19 Apr 2024 13:46:00 +0200 Subject: [PATCH] Faster FileInfoMatcher (#5830) RealpathMatcher cannot resolve wildcards -> early return to prevent unnecessary IO --- src/Skipper/Matcher/FileInfoMatcher.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Skipper/Matcher/FileInfoMatcher.php b/src/Skipper/Matcher/FileInfoMatcher.php index c7110345d01..a2349490f79 100644 --- a/src/Skipper/Matcher/FileInfoMatcher.php +++ b/src/Skipper/Matcher/FileInfoMatcher.php @@ -61,6 +61,11 @@ private function doesFileMatchPattern(string $filePath, string $ignoredPath): bo return true; } + // realpathMatcher cannot resolve wildcards -> return early to prevent unnecessary IO + if (str_contains($ignoredPath, '*')) { + return false; + } + return $this->realpathMatcher->match($ignoredPath, $filePath); } }