public function checkSubmodules($repo)
{
if ($this->scanSubmodules) {
$this->cli->out('Scanning repository...');
}
$output = $this->git->command('submodule status', $repo);
if ($this->scanSubmodules) {
$this->cli->out(' Found ' . count($output) . ' submodules.');
}
if (count($output) > 0) {
foreach ($output as $line) {
$line = explode(' ', trim($line));
// If submodules are turned off, don't add them to queue
if ($this->scanSubmodules) {
$this->submodules[] = ['revision' => $line[0], 'name' => $line[1], 'path' => $repo . '/' . $line[1]];
$this->cli->out(sprintf(' Found submodule %s. %s', $line[1], $this->scanSubSubmodules ? PHP_EOL . ' Scanning for sub-submodules...' : null));
}
$this->globalFilesToExclude[] = $line[1];
$this->checkSubSubmodules($repo, $line[1]);
}
if (!$this->scanSubSubmodules) {
$this->cli->out(' Skipping search for sub-submodules.');
}
}
}