From 067348c6ea769ef786b0818198ca7d025b467243 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 5 Mar 2020 21:32:44 +0000 Subject: [PATCH] Issue #3115624 by martijn.cuppens, jungle, JeroenT, greg.1.anderson, Mile23: Scaffolding: Only add root files to gitignore (cherry picked from commit e3e5937d5c0348056f40a3ecaa5b8ebbac7bf2ed) --- composer/Plugin/Scaffold/ManageGitIgnore.php | 2 +- .../Functional/ManageGitIgnoreTest.php | 24 +++++++++---------- .../docroot/.gitignore | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/composer/Plugin/Scaffold/ManageGitIgnore.php b/composer/Plugin/Scaffold/ManageGitIgnore.php index dcb03fafcb8..524cb2ff605 100644 --- a/composer/Plugin/Scaffold/ManageGitIgnore.php +++ b/composer/Plugin/Scaffold/ManageGitIgnore.php @@ -61,7 +61,7 @@ class ManageGitIgnore { if (!$is_tracked && $scaffoldResult->isManaged()) { $dir = realpath(dirname($path)); $name = basename($path); - $add_to_git_ignore[$dir][] = $name; + $add_to_git_ignore[$dir][] = '/' . $name; } } } diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php index c73faf74bdf..ea965164b11 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php @@ -112,18 +112,18 @@ class ManageGitIgnoreTest extends TestCase { $this->assertFileExists($sut . '/docroot/autoload.php'); $this->assertFileExists($sut . '/docroot/index.php'); $expected = <<