예제 #1
0
파일: Commit.php 프로젝트: mlukman/gitsync
 /**
  * number of commits that lead to this one
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return int|void
  */
 public function count()
 {
     $command = RevListCommand::getInstance($this->getRepository())->commitPath($this);
     return count($this->getCaller()->execute($command)->getOutputLines(true));
 }
예제 #2
0
파일: Tag.php 프로젝트: ocubom/GitElephant
 /**
  * parse the output of a git command showing a commit
  *
  * @param array $outputLines output lines
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return void
  */
 private function parseOutputLines($outputLines)
 {
     $found = false;
     foreach ($outputLines as $tagString) {
         if ($tagString != '') {
             if ($this->name === trim($tagString)) {
                 $lines = $this->getCaller()->execute(RevListCommand::getInstance($this->getRepository())->getTagCommit($this))->getOutputLines();
                 $this->setSha($lines[0]);
                 $found = true;
                 break;
             }
         }
     }
     if (!$found) {
         throw new \InvalidArgumentException(sprintf('the tag %s doesn\'t exists', $this->name));
     }
 }