Просмотр исходного кода

Keep dev-versions up to date for valid branches

Anton Minin 10 лет назад
Родитель
Сommit
03379157f0
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      src/Packagist/WebBundle/Package/Updater.php

+ 3 - 4
src/Packagist/WebBundle/Package/Updater.php

@@ -98,10 +98,6 @@ class Updater
         $versions = $repository->getPackages();
         $em = $this->doctrine->getManager();
 
-        if ($repository->hadInvalidBranches()) {
-            throw new InvalidRepositoryException('Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches');
-        }
-
         usort($versions, function ($a, $b) {
             $aVersion = $a->getVersion();
             $bVersion = $b->getVersion();
@@ -169,6 +165,9 @@ class Updater
         $package->setUpdatedAt(new \DateTime);
         $package->setCrawledAt(new \DateTime);
         $em->flush();
+        if ($repository->hadInvalidBranches()) {
+            throw new InvalidRepositoryException('Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches');
+        }
     }
 
     private function updateInformation(Package $package, PackageInterface $data, $flags)