3 final class DiffusionGitRawDiffQuery
extends DiffusionRawDiffQuery
{
5 protected function newQueryFuture() {
6 $drequest = $this->getRequest();
7 $repository = $drequest->getRepository();
9 $commit = $this->getAnchorCommit();
18 '-U'.(int)$this->getLinesOfContext(),
21 $against = $this->getAgainstCommit();
22 if ($against === null) {
23 // Check if this is the root commit by seeing if it has parents, since
24 // `git diff X^ X` does not work if "X" is the initial commit.
25 list($parents) = $repository->execxLocalCommand(
28 gitsprintf('%s', $commit));
30 if (strlen(trim($parents))) {
31 $against = $commit.'^';
33 $against = ArcanistGitAPI
::GIT_MAGIC_ROOT_COMMIT
;
37 $path = $drequest->getPath();
42 return $repository->getLocalCommandFuture(
43 'diff %Ls %s %s -- %s',
45 gitsprintf('%s', $against),
46 gitsprintf('%s', $commit),