Do not reset references on update mirrors if VCS type has changed
parent
2d37bb4116
commit
cc274ebdf4
|
@ -158,9 +158,14 @@ class LockTransaction
|
||||||
foreach ($this->resultPackages[$devMode ? 'dev' : 'non-dev'] as $package) {
|
foreach ($this->resultPackages[$devMode ? 'dev' : 'non-dev'] as $package) {
|
||||||
if (!($package instanceof AliasPackage) && !($package instanceof RootAliasPackage)) {
|
if (!($package instanceof AliasPackage) && !($package instanceof RootAliasPackage)) {
|
||||||
// if we're just updating mirrors we need to reset references to the same as currently "present" packages' references to keep the lock file as-is
|
// if we're just updating mirrors we need to reset references to the same as currently "present" packages' references to keep the lock file as-is
|
||||||
|
// we do not reset references if the currently present package didn't have any, or if the type of VCS has changed
|
||||||
if ($updateMirrors && !isset($this->presentMap[spl_object_hash($package)])) {
|
if ($updateMirrors && !isset($this->presentMap[spl_object_hash($package)])) {
|
||||||
foreach ($this->presentMap as $presentPackage) {
|
foreach ($this->presentMap as $presentPackage) {
|
||||||
if ($package->getName() == $presentPackage->getName() && $package->getVersion() == $presentPackage->getVersion() && $presentPackage->getSourceReference()) {
|
if ($package->getName() == $presentPackage->getName() &&
|
||||||
|
$package->getVersion() == $presentPackage->getVersion() &&
|
||||||
|
$presentPackage->getSourceReference() &&
|
||||||
|
$presentPackage->getSourceType() === $package->getSourceType()
|
||||||
|
) {
|
||||||
$package->setSourceDistReferences($presentPackage->getSourceReference());
|
$package->setSourceDistReferences($presentPackage->getSourceReference());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue