From 75cb3cf35819661d4c1abcee1e9a71c46b9cc2c8 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 15 May 2014 19:03:29 -0700 Subject: [PATCH] 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 --- src/workflow/ArcanistDiffWorkflow.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; -- 2.43.0