Commit 067348c6 authored by alexpott's avatar alexpott

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 22a5ccaa
......@@ -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;
}
}
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment