getRequest(); $repository = $drequest->getRepository(); if (!$drequest->getRawCommit()) { $effective_commit = $this->getEffectiveCommit(); if (!$effective_commit) { return null; } // TODO: This side effect is kind of skethcy. $drequest->setCommit($effective_commit); } else { $effective_commit = $drequest->getCommit(); } $options = array( '-M', '-C', '--no-ext-diff', '--no-color', '--src-prefix=a/', '--dst-prefix=b/', '-U65535', ); $options = implode(' ', $options); list($raw_diff) = execx( "(cd %s && git diff {$options} %s^ %s -- %s)", $repository->getDetail('local-path'), $effective_commit, $effective_commit, $drequest->getPath()); $parser = new ArcanistDiffParser(); $parser->setDetectBinaryFiles(true); $changes = $parser->parseDiff($raw_diff); $diff = DifferentialDiff::newFromRawChanges($changes); $changesets = $diff->getChangesets(); $changeset = reset($changesets); $this->renderingReference = $drequest->getBranchURIComponent($drequest->getBranch()). $drequest->getPath().';'. $drequest->getCommit(); return $changeset; } }