Differential D21511 Diff 51201 src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/rawdiff/DiffusionGitRawDiffQuery.php
| Show All 17 Lines | $options = array( | ||||
| '-U'.(int)$this->getLinesOfContext(), | '-U'.(int)$this->getLinesOfContext(), | ||||
| ); | ); | ||||
| $against = $this->getAgainstCommit(); | $against = $this->getAgainstCommit(); | ||||
| if ($against === null) { | if ($against === null) { | ||||
| // Check if this is the root commit by seeing if it has parents, since | // Check if this is the root commit by seeing if it has parents, since | ||||
| // `git diff X^ X` does not work if "X" is the initial commit. | // `git diff X^ X` does not work if "X" is the initial commit. | ||||
| list($parents) = $repository->execxLocalCommand( | list($parents) = $repository->execxLocalCommand( | ||||
| 'log -n 1 --format=%s %s --', | 'log -n 1 %s --', | ||||
| '%P', | '--format=%P', | ||||
| gitsprintf('%s', $commit)); | gitsprintf('%s', $commit)); | ||||
| if (strlen(trim($parents))) { | if (strlen(trim($parents))) { | ||||
| $against = $commit.'^'; | $against = $commit.'^'; | ||||
| } else { | } else { | ||||
| $against = ArcanistGitAPI::GIT_MAGIC_ROOT_COMMIT; | $against = ArcanistGitAPI::GIT_MAGIC_ROOT_COMMIT; | ||||
| } | } | ||||
| } | } | ||||
| Show All 15 Lines | |||||