Support also default_branch flag in cached versions
parent
52afa5ef16
commit
4682efcf77
|
@ -313,7 +313,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
||||||
$version = $prefix . preg_replace('{(\.9{7})+}', '.x', $parsedBranch);
|
$version = $prefix . preg_replace('{(\.9{7})+}', '.x', $parsedBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
$cachedPackage = $this->getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose);
|
$cachedPackage = $this->getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose, $driver->getRootIdentifier() === $branch);
|
||||||
if ($cachedPackage) {
|
if ($cachedPackage) {
|
||||||
$this->addPackage($cachedPackage);
|
$this->addPackage($cachedPackage);
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose)
|
private function getCachedPackageVersion($version, $identifier, $isVerbose, $isVeryVerbose, $isDefaultBranch = false)
|
||||||
{
|
{
|
||||||
if (!$this->versionCache) {
|
if (!$this->versionCache) {
|
||||||
return;
|
return;
|
||||||
|
@ -446,6 +446,11 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
||||||
$this->io->overwriteError($msg, false);
|
$this->io->overwriteError($msg, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($cachedPackage['default_branch']);
|
||||||
|
if ($isDefaultBranch) {
|
||||||
|
$cachedPackage['default_branch'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($existingPackage = $this->findPackage($cachedPackage['name'], new Constraint('=', $cachedPackage['version_normalized']))) {
|
if ($existingPackage = $this->findPackage($cachedPackage['name'], new Constraint('=', $cachedPackage['version_normalized']))) {
|
||||||
if ($isVeryVerbose) {
|
if ($isVeryVerbose) {
|
||||||
$this->io->writeError('<warning>Skipped cached version '.$version.', it conflicts with an another tag ('.$existingPackage->getPrettyVersion().') as both resolve to '.$cachedPackage['version_normalized'].' internally</warning>');
|
$this->io->writeError('<warning>Skipped cached version '.$version.', it conflicts with an another tag ('.$existingPackage->getPrettyVersion().') as both resolve to '.$cachedPackage['version_normalized'].' internally</warning>');
|
||||||
|
|
Loading…
Reference in New Issue