Exemplo n.º 1
0
 public function setRemote($name, $url, $add = false, $push = false)
 {
     if (isset($this->getRemotes()[$name])) {
         $cmd = ['remote set-url'];
         $add && ($cmd[] = '--add');
         $push && ($cmd[] = '--push');
         $cmd[] = '%s %s';
         //$name $url
         $this->caller->execute(sprintf(implode(' ', $cmd), $name, $url));
     } else {
         $this->addRemote($name, $url);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * testGetRawOutput
  */
 public function testGetRawOutput()
 {
     $binary = new GitBinary();
     $this->getRepository()->init();
     $caller = new Caller($binary, $this->getRepository()->getPath());
     $caller->execute('status');
     $this->assertRegExp('/master/', $caller->getRawOutput($caller->getRawOutput()));
 }
Exemplo n.º 3
0
 /**
  * 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();
 }