Example #1
0
 /**
  * get the commit properties from command
  *
  * @see LsTreeCommand::tree
  */
 private function createFromCommand()
 {
     $command = LsTreeCommand::getInstance($this->getRepository())->tree($this->ref, $this->subject);
     $outputLines = $this->getCaller()->execute($command)->getOutputLines(true);
     $this->parseOutputLines($outputLines);
 }
Example #2
0
 /**
  * Retrieve an instance of Tree
  * Tree Object is Countable, Iterable and has ArrayAccess for easy manipulation
  *
  * @param string|TreeishInterface $ref  the treeish to check
  * @param string|Object           $path Object or null for root
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\LogicException
  * @throws \Symfony\Component\Process\Exception\InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return Objects\Tree
  */
 public function getTree($ref = 'HEAD', $path = null)
 {
     if (is_string($path) && '' !== $path) {
         $outputLines = $this->getCaller()->execute(LsTreeCommand::getInstance($this)->tree($ref, $path))->getOutputLines(true);
         $path = TreeObject::createFromOutputLine($this, $outputLines[0]);
     }
     return new Tree($this, $ref, $path);
 }