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

(cherry picked from commit e3e5937d5c)
merge-requests/64/head
Alex Pott 2020-03-05 21:32:44 +00:00
parent 580a8536d6
commit 2784f6a4b7
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
3 changed files with 14 additions and 14 deletions

View File

@ -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;
}
}
}

View File

@ -112,18 +112,18 @@ class ManageGitIgnoreTest extends TestCase {
$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