Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f3cb377

Browse filesBrowse files
committed
[Finder] Fix finding VCS re-included files in excluded directory
1 parent 6a52b66 commit f3cb377
Copy full SHA for f3cb377

File tree

2 files changed

+14
-2
lines changed
Filter options

2 files changed

+14
-2
lines changed

‎src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ private function isIgnored(string $fileRealPath): bool
6060

6161
foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) {
6262
if ($this->isIgnored($parentDirectory)) {
63-
$ignored = true;
64-
6563
// rules in ignored directories are ignored, no need to check further.
6664
break;
6765
}

‎src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Tests/Iterator/VcsIgnoredFilterIteratorTest.php
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,20 @@ public function getAcceptData(): iterable
247247
'a/b/c/d.txt',
248248
],
249249
];
250+
251+
yield 'file included from subdirectory with everything excluded' => [
252+
[
253+
'.gitignore' => "/a/**\n!/a/b.txt",
254+
],
255+
[
256+
'a/a.txt',
257+
'a/b.txt',
258+
'a/c.txt',
259+
],
260+
[
261+
'a/b.txt',
262+
],
263+
];
250264
}
251265

252266
public function testAcceptAtRootDirectory()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.