/**
* Manages gitignore files.
*
* @param \Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldResult[] $files
* A list of scaffold results, each of which holds a path and whether
* or not that file is managed.
* @param \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions $options
* Configuration options from the composer.json extras section.
*/
public function manageIgnored(array
$files, ScaffoldOptions
$options) { if (!
$this->
managementOfGitIgnoreEnabled($options)) { return;
} // Accumulate entries to add to .gitignore, sorted into buckets based on the
// location of the .gitignore file the entry should be added to.
$add_to_git_ignore =
[];
foreach ($files as $scaffoldResult) { $path =
$scaffoldResult->
destination()->
fullPath();
$is_ignored = Git::
checkIgnore($this->io,
$path,
$this->dir
);
if (!
$is_ignored) { $is_tracked = Git::
checkTracked($this->io,
$path,
$this->dir
);