]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix `arc diff --raw` when run outside a repository
authorepriestley <git@epriestley.com>
Fri, 16 May 2014 02:03:29 +0000 (19:03 -0700)
committerepriestley <git@epriestley.com>
Fri, 16 May 2014 02:03:29 +0000 (19:03 -0700)
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

index 7a69ada353be2e5538329df0df0852385f38ae73..19ebe662df4cb1d0fd182b7bc57e819289014db9 100644 (file)
@@ -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;