Esempio n. 1
0
 private function checkoutBranch(OutputInterface $output, $branch, $tmpDirectory)
 {
     $output->writeln("Checking out branch <info>{$branch}</info>");
     try {
         $this->git->checkoutOriginBranch($tmpDirectory, $branch);
     } catch (CommandException $e) {
         // The branch doesn't exist yet, so we create it
         try {
             $this->git->createBranch($tmpDirectory, $branch);
         } catch (CommandException $e) {
             throw new \RuntimeException("Unable to create the branch '{$branch}'" . PHP_EOL . $e->getMessage());
         }
     }
 }