/** * @return Diff */ public function getDiff() { $args = array('-r', '-p', '-m', '-M', '--no-commit-id', '--full-index', $this->revision); $diff = Diff::parse($this->repository->run('diff-tree', $args)); $diff->setRepository($this->repository); return $diff; }
/** * @param string $file Path to file * * @return Diff */ public function getDiffFile($file) { $args = ['-r', '-p', '-m', '-M', '--no-commit-id', '--full-index', $this->revision, '--', $this->repository->getWikiDir() . $file]; $diff = Diff::parse($this->repository->run('diff-tree', $args)); $diff->setRepository($this->repository); return $diff; }
/** * @return Diff */ public function getDiff($revisions) { if (null !== $revisions && !$revisions instanceof RevisionList) { $revisions = new RevisionList($this, $revisions); } $args = array_merge(array('-r', '-p', '-m', '-M', '--no-commit-id', '--full-index'), $revisions->getAsTextArray()); $diff = Diff::parse($this->run('diff', $args)); $diff->setRepository($this); return $diff; }
/** * @param string $rawDiff * * @return FilesCollection */ public function locateFromRawDiffInput($rawDiff) { $diff = Diff::parse($rawDiff); $diff->setRepository($this->repository); return $this->parseFilesFromDiff($diff); }
public function getDiffStaged() { $diff = Diff::parse($this->run('diff', array('-r', '-p', '-m', '-M', '--full-index', '--staged'))); $diff->setRepository($this->repository); return $diff; }