1
0
Fork 0

composer status now includes untracked files in git repos, fixes #2664

pull/5208/head
Jordi Boggiano 2016-04-15 16:22:16 +01:00
parent 4f6693ad70
commit b31052fcde
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ EOT
$errors[$targetDir] = $targetDir . ' is a symbolic link.';
}
if ($changes = $downloader->getLocalChanges($package, $targetDir)) {
if ($changes = $downloader->getLocalChanges($package, $targetDir, true)) {
$errors[$targetDir] = $changes;
}

View File

@ -97,14 +97,14 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
/**
* {@inheritDoc}
*/
public function getLocalChanges(PackageInterface $package, $path)
public function getLocalChanges(PackageInterface $package, $path, $showUntracked = false)
{
GitUtil::cleanEnv();
if (!$this->hasMetadataRepository($path)) {
return;
}
$command = 'git status --porcelain --untracked-files=no';
$command = 'git status --porcelain ' . ($showUntracked ? '' : ' --untracked-files=no');
if (0 !== $this->process->execute($command, $output, $path)) {
throw new \RuntimeException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput());
}