1
0
Fork 0

Make sure update mirrors/--lock keeps the release date of the original reference when dev versions have newer commits, refs #9812

pull/9821/head
Jordi Boggiano 2021-04-08 11:54:39 +02:00
parent 0ab4013788
commit e6cede4a61
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 8 additions and 7 deletions

View File

@ -93,13 +93,14 @@ class LockTransaction extends Transaction
// 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)])) {
foreach ($this->presentMap as $presentPackage) {
if ($package->getName() == $presentPackage->getName() &&
$package->getVersion() == $presentPackage->getVersion() &&
$presentPackage->getSourceReference() &&
$presentPackage->getSourceType() === $package->getSourceType()
) {
if ($package->getName() == $presentPackage->getName() && $package->getVersion() == $presentPackage->getVersion()) {
if ($presentPackage->getSourceReference() && $presentPackage->getSourceType() === $package->getSourceType()) {
$package->setSourceDistReferences($presentPackage->getSourceReference());
}
if ($presentPackage->getReleaseDate()) {
$package->setReleaseDate($presentPackage->getReleaseDate());
}
}
}
}
$packages[] = $package;

View File

@ -154,7 +154,7 @@ g/g is dev and installed in a different ref than the #ref, so it gets updated an
"name": "a/a", "version": "dev-master",
"source": { "reference": "1111111111111111111111111111111111111111", "url": "https://github.com/a/newa", "type": "git" },
"dist": { "reference": "1111111111111111111111111111111111111111", "url": "https://api.github.com/repos/a/newa/zipball/1111111111111111111111111111111111111111", "type": "zip" },
"time": "2021-03-27T14:32:16+00:00",
"time": "2021-03-14T16:24:37+00:00",
"type": "library"
},
{