Ver Fonte

Output error if a VCS repo has no package at all instead of silently going through

Jordi Boggiano há 12 anos atrás
pai
commit
ec301ea8bb
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      src/Composer/Repository/VcsRepository.php

+ 4 - 0
src/Composer/Repository/VcsRepository.php

@@ -226,6 +226,10 @@ class VcsRepository extends ArrayRepository
         }
 
         $this->io->overwrite('', false);
+
+        if (!$this->getPackages()) {
+            throw new \RuntimeException('No composer.json was found in any branch or tag of '.$this->url.', could not load a package from it.');
+        }
     }
 
     private function preProcess(VcsDriverInterface $driver, array $data, $identifier)