public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
$this->packageDataManager->setPackageInstallationSource($initial);
$this->packageDataManager->setPackageInstallationSource($target);
// The package need only a code update because the version (branch), only the commit changed
if ($this->getInstallPath($initial) === $this->getInstallPath($target)) {
$this->createPackageVendorSymlink($target);
parent::update($repo, $initial, $target);
} else {
// If the initial package sources folder exists, uninstall it
$this->composer->getInstallationManager()->uninstall($repo, new UninstallOperation($initial));
// Install the target package
$this->composer->getInstallationManager()->install($repo, new InstallOperation($target));
}
}