Exemple #1
0
 /**
  * Removes a branch
  * @param Branch $branch The branch to remove
  */
 public function removeBranch(Branch $branch)
 {
     $this->io->removeRef($branch->getHead());
 }
Exemple #2
0
 /**
  * Writes the branch to IO
  * @param IOInterface $io An IOInterface to write to
  */
 public function write(IOInterface $io)
 {
     if (!$this->ref) {
         throw new \LogicException('Branch cannot be written if no head reference exists');
     }
     try {
         $io->removeRef($this->ref);
     } catch (\RuntimeException $e) {
         //Nothing to worry about, the ref just does not exist.
     }
     $this->ref->write($io);
 }