From: epriestley Date: Fri, 16 May 2014 02:03:29 +0000 (-0700) Subject: Fix `arc diff --raw` when run outside a repository X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=75cb3cf35819661d4c1abcee1e9a71c46b9cc2c8;p=arcanist.git Fix `arc diff --raw` when run outside a repository Summary: Fixes T5071. If you run `arc diff --raw` from some arbitrary, non-repository directory we incorrectly try to read information out of the working copy. Even if this information is available, `arc diff --raw` should not assume it's accurate (there's no guarantee the diff comes from the working copy). Test Plan: Ran `arc diff --raw` in an arbitrary directory. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T5071 Differential Revision: https://secure.phabricator.com/D9142 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 7a69ada3..19ebe662 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -2292,9 +2292,11 @@ EOTEXT 'arcanistProject' => $project_id, ); - $repository_phid = $this->getRepositoryPHID(); - if ($repository_phid) { - $data['repositoryPHID'] = $repository_phid; + if (!$this->isRawDiffSource()) { + $repository_phid = $this->getRepositoryPHID(); + if ($repository_phid) { + $data['repositoryPHID'] = $repository_phid; + } } return $data;