Skip to content
Snippets Groups Projects
Commit 36f5ecd3 authored by Kunal Sachdev's avatar Kunal Sachdev Committed by Adam G-H
Browse files

Issue #3342726 by kunal.sachdev, Wim Leers: UnknownPathExcluder doesn’t consider hidden files

parent a8533e25
No related branches found
No related tags found
5 merge requests!989Issue #3356804 by phenaproxima: Flag a warning during status check if the...,!715Issue #3342726: UnknownPathExcluder doesn’t consider hidden files.,!685Issue #3338667: [PP-1] Add build test to test cweaganscomposer-patches end-to-end,!548Issue #3310729: Incorrect documentation link in UI in case of Process error,!106Issue #3247479: Allow LockFileValidator results to carry multiple messages, and improve their text
......@@ -64,7 +64,8 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// @todo Refactor in https://www.drupal.org/project/automatic_updates/issues/3334994.
$core_packages = $event->stage->getActiveComposer()->getCorePackages();
$scaffold_files_paths = $this->getScaffoldFiles($core_packages);
$paths_in_project_root = glob("$project_root/*");
// Search for all files (including hidden ones) in project root.
$paths_in_project_root = glob("$project_root/{,.}*", GLOB_BRACE);
$paths = [];
$known_paths = array_merge([$vendor_dir, $web_root, "$project_root/composer.json", "$project_root/composer.lock"], $scaffold_files_paths);
foreach ($paths_in_project_root as $path_in_project_root) {
......
......@@ -94,6 +94,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
NULL,
['unknown_file.txt'],
],
'unknown hidden file where web and project root same' => [
FALSE,
NULL,
['.unknown_file'],
],
'unknown hidden file where web and project root different' => [
TRUE,
NULL,
['.unknown_file'],
],
'unknown directory where web and project root same' => [
FALSE,
'unknown_dir',
......@@ -104,6 +114,16 @@ class UnknownPathExcluderTest extends PackageManagerKernelTestBase {
'unknown_dir',
['unknown_dir/unknown_dir.README.md', 'unknown_dir/unknown_file.txt'],
],
'unknown hidden directory where web and project root same' => [
FALSE,
'.unknown_dir',
['.unknown_dir/unknown_dir.README.md', '.unknown_dir/unknown_file.txt'],
],
'unknown hidden directory where web and project root different' => [
TRUE,
'.unknown_dir',
['.unknown_dir/unknown_dir.README.md', '.unknown_dir/unknown_file.txt'],
],
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment