File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/Symfony/Component/Finder Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ public static function toRegex(string $gitignoreFileContent): string
5555 private static function lineToRegex (string $ gitignoreLine ): string
5656 {
5757 if ('' === $ gitignoreLine ) {
58- return '(?:$f) ' ; // always false
58+ return '$f ' ; // always false
5959 }
6060
6161 $ slashPos = strpos ($ gitignoreLine , '/ ' );
@@ -80,10 +80,8 @@ private static function lineToRegex(string $gitignoreLine): string
8080 return $ v ;
8181 }, explode ('/ ' , $ gitignoreLine ));
8282
83- return '(?: '
84- .($ isAbsolute ? '' : '(?:[^/]+/)* ' )
83+ return ($ isAbsolute ? '' : '(?:[^/]+/)* ' )
8584 .implode ('/ ' , $ parts )
86- .('' !== end ($ parts ) ? '(?:$|/) ' : '' )
87- .') ' ;
85+ .('' !== end ($ parts ) ? '(?:$|/) ' : '' );
8886 }
8987}
You can’t perform that action at this time.
0 commit comments