From 2296602ccfe8cd8737ca3d62353eb969e1b19229 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sat, 5 Oct 2019 13:10:26 +0100
Subject: [PATCH] Issue #3085354 by greg.1.anderson, mbaynton, hussainweb:
 Better default behavior for scaffold-created .gitignore files

---
 composer/Plugin/Scaffold/ManageGitIgnore.php | 5 ++---
 composer/Plugin/Scaffold/README.md           | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/composer/Plugin/Scaffold/ManageGitIgnore.php b/composer/Plugin/Scaffold/ManageGitIgnore.php
index 17e63e07a41e..5f1bb9dc9574 100644
--- a/composer/Plugin/Scaffold/ManageGitIgnore.php
+++ b/composer/Plugin/Scaffold/ManageGitIgnore.php
@@ -91,9 +91,8 @@ protected function managementOfGitIgnoreEnabled(ScaffoldOptions $options) {
     }
 
     // If the composer.json did not specify whether or not .gitignore files
-    // should be managed, then manage them if the vendor directory is not
-    // committed.
-    return !Git::checkTracked($this->io, 'vendor', $this->dir);
+    // should be managed, then manage them if the vendor directory is ignored.
+    return Git::checkIgnore($this->io, 'vendor', $this->dir);
   }
 
   /**
diff --git a/composer/Plugin/Scaffold/README.md b/composer/Plugin/Scaffold/README.md
index 5b7ce24d8a22..c4a060627237 100644
--- a/composer/Plugin/Scaffold/README.md
+++ b/composer/Plugin/Scaffold/README.md
@@ -302,7 +302,7 @@ manage `.gitignore` files for files written during the scaffold operation.
 - true: `.gitignore` files will be updated when scaffold files are written.
 - false: `.gitignore` files will never be modified.
 - Not set: `.gitignore` files will be updated if the target directory is a local
-working copy of a git repository, and the `vendor` directory is not committed
+working copy of a git repository, and the `vendor` directory is ignored
 in that repository.
 
 ### locations
-- 
GitLab