1
0
Fork 0

Clarify behavior of name in VCS repo, closes #9752

pull/9771/head
Jordi Boggiano 2021-03-09 23:00:17 +01:00
parent c81562b343
commit 17747181d0
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 3 additions and 1 deletions

View File

@ -247,7 +247,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
continue;
}
$tagPackageName = isset($data['name']) ? $data['name'] : $this->packageName;
$tagPackageName = $this->packageName ?: (isset($data['name']) ? $data['name'] : '');
if ($existingPackage = $this->findPackage($tagPackageName, $data['version_normalized'])) {
if ($isVeryVerbose) {
$this->io->writeError('<warning>Skipped tag '.$tag.', it conflicts with an another tag ('.$existingPackage->getPrettyVersion().') as both resolve to '.$data['version_normalized'].' internally</warning>');
@ -386,6 +386,8 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
protected function preProcess(VcsDriverInterface $driver, array $data, $identifier)
{
// keep the name of the main identifier for all packages
// this ensures that a package can be renamed in one place and that all old tags
// will still be installable using that new name without requiring re-tagging
$dataPackageName = isset($data['name']) ? $data['name'] : null;
$data['name'] = $this->packageName ?: $dataPackageName;