1
0
Fork 0

Make sure alias packages installed with create-project end up with the correct branch checked out, fixes #6082

pull/6099/head
Jordi Boggiano 2017-01-22 18:44:15 +01:00
parent e4840ee413
commit 9a26a9e8f8
1 changed files with 5 additions and 0 deletions

View File

@ -23,6 +23,7 @@ use Composer\Package\BasePackage;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\Package\Version\VersionSelector;
use Composer\Package\AliasPackage;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
@ -330,6 +331,10 @@ EOT
$io->writeError('<info>Plugins have been disabled.</info>');
}
if ($package instanceof AliasPackage) {
$package = $package->getAliasOf();
}
if (0 === strpos($package->getPrettyVersion(), 'dev-') && in_array($package->getSourceType(), array('git', 'hg'))) {
$package->setSourceReference(substr($package->getPrettyVersion(), 4));
}