Example #1
0
 /**
  * pick an existing commit
  *
  * @param Repository              $repository repository
  * @param TreeishInterface|string $treeish    treeish
  *
  * @throws \RuntimeException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return Commit
  */
 public static function pick(Repository $repository, $treeish = null)
 {
     $commit = new self($repository, $treeish);
     $commit->createFromCommand();
     return $commit;
 }
Example #2
0
 /**
  * static generator to generate a Diff object
  *
  * @param \GitElephant\Repository                 $repository repository
  * @param null|string|\GitElephant\Objects\Commit $commit1    first commit
  * @param null|string|\GitElephant\Objects\Commit $commit2    second commit
  * @param null|string                             $path       path to consider
  *
  * @throws \RuntimeException
  * @throws \InvalidArgumentException
  * @throws \Symfony\Component\Process\Exception\RuntimeException
  * @return Diff
  */
 public static function create(Repository $repository, $commit1 = null, $commit2 = null, $path = null)
 {
     $commit = new self($repository);
     $commit->createFromCommand($commit1, $commit2, $path);
     return $commit;
 }