コード例 #1
0
 /**
  * CatFileCommand::content()
  */
 public function testContent()
 {
     $cfc = new CatFileCommand();
     $master = $this->getRepository()->getBranch('master');
     $tree = $this->getRepository()->getTree('HEAD', 'test-folder/test2');
     $this->assertEquals(sprintf("cat-file '-p' '%s:test-folder/test2'", $master->getSha()), $cfc->content($tree->getBlob(), $master));
     $this->getRepository()->createTag('test-tag');
     $tag = $this->getRepository()->getTag('test-tag');
     $this->assertEquals(sprintf("cat-file '-p' '%s:test-folder/test2'", $tag->getSha()), $cfc->content($tree->getBlob(), $tag));
     $this->assertEquals(sprintf("cat-file '-p' '%s:test-folder/test2'", $tag->getSha()), $cfc->content($tree->getBlob(), $tag->getSha()));
 }
コード例 #2
0
ファイル: Tree.php プロジェクト: ocubom/GitElephant
 /**
  * get binary data
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return string
  */
 public function getBinaryData()
 {
     $cmd = CatFileCommand::getInstance($this->getRepository())->content($this->getSubject(), $this->ref);
     return $this->getCaller()->execute($cmd)->getRawOutput();
 }
コード例 #3
0
ファイル: Repository.php プロジェクト: mlukman/gitsync
 /**
  * output a node raw content
  *
  * @param \GitElephant\Objects\Object                  $obj     The Object of type BLOB
  * @param \GitElephant\Objects\TreeishInterface|string $treeish A treeish object
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return string
  */
 public function outputRawContent(Object $obj, $treeish)
 {
     $command = CatFileCommand::getInstance($this)->content($obj, $treeish);
     return $this->caller->execute($command)->getRawOutput();
 }