Unverified Commit 2784f6a4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3115624 by martijn.cuppens, jungle, JeroenT, greg.1.anderson, Mile23:...

Issue #3115624 by martijn.cuppens, jungle, JeroenT, greg.1.anderson, Mile23: Scaffolding: Only add root files to gitignore

(cherry picked from commit e3e5937d)
parent 580a8536
Loading
Loading
Loading
Loading
+1 −1
Changes for composer/Plugin/Scaffold/ManageGitIgnore.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public function manageIgnored(array $files, ScaffoldOptions $options) {
        if (!$is_tracked && $scaffoldResult->isManaged()) {
          $dir = realpath(dirname($path));
          $name = basename($path);
          $add_to_git_ignore[$dir][] = $name;
          $add_to_git_ignore[$dir][] = '/' . $name;
        }
      }
    }
+12 −12
Changes for core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ManageGitIgnoreTest.php: 12 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -112,18 +112,18 @@ public function testManageGitIgnore() {
    $this->assertFileExists($sut . '/docroot/autoload.php');
    $this->assertFileExists($sut . '/docroot/index.php');
    $expected = <<<EOT
build
.csslintrc
.editorconfig
.eslintignore
.eslintrc.json
.gitattributes
.ht.router.php
autoload.php
index.php
robots.txt
update.php
web.config
/build
/.csslintrc
/.editorconfig
/.eslintignore
/.eslintrc.json
/.gitattributes
/.ht.router.php
/autoload.php
/index.php
/robots.txt
/update.php
/web.config
EOT;
    // At this point we should have a .gitignore file, because although we did
    // not explicitly ask for .gitignore tracking, the vendor directory is not
+1 −1
Changes for core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-composer-drupal-project/docroot/.gitignore: 1 added line, 1 removed line.
Original line number Diff line number Diff line
build
 No newline at end of file
/build