Пример #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;
 }
Пример #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()));
 }
Пример #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();
 }