Ver Fonte

Add a way to know if any branch failed loading

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

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

@@ -36,6 +36,7 @@ class VcsRepository extends ArrayRepository
     protected $type;
     protected $loader;
     protected $repoConfig;
+    protected $branchErrorOccurred = false;
 
     public function __construct(array $repoConfig, IOInterface $io, Config $config, array $drivers = null)
     {
@@ -90,6 +91,11 @@ class VcsRepository extends ArrayRepository
         }
     }
 
+    public function hadInvalidBranches()
+    {
+        return $this->branchErrorOccurred;
+    }
+
     protected function initialize()
     {
         parent::initialize();
@@ -234,6 +240,7 @@ class VcsRepository extends ArrayRepository
                 if (!$verbose) {
                     $this->io->write('');
                 }
+                $this->branchErrorOccurred = true;
                 $this->io->write('Skipped branch '.$branch.', '.$e->getMessage());
                 $this->io->write('');
                 continue;