Skip to content

Commit

Permalink
Fix show --all showing only the installed version if the package is i…
Browse files Browse the repository at this point in the history
…nstalled, fixes #10095
  • Loading branch information
Seldaek committed Oct 2, 2021
1 parent a7963b7 commit 532c6e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Composer/Command/ShowCommand.php
Expand Up @@ -27,6 +27,7 @@
use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\ComposerRepository;
use Composer\Repository\CompositeRepository;
use Composer\Repository\FilterRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\InstalledRepository;
Expand Down Expand Up @@ -184,7 +185,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
} else {
$installedRepo = new InstalledRepository(array($localRepo, $platformRepo));
}
$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
$repos = new CompositeRepository(array_merge(array(new FilterRepository($installedRepo, array('canonical' => false))), $composer->getRepositoryManager()->getRepositories()));
} elseif ($input->getOption('all')) {
$defaultRepos = RepositoryFactory::defaultRepos($io);
$io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));
Expand Down

0 comments on commit 532c6e7

Please sign in to comment.