]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Fix `arc diff --no-ansi`
authorepriestley <git@epriestley.com>
Thu, 24 Jan 2013 22:28:28 +0000 (14:28 -0800)
committerepriestley <git@epriestley.com>
Thu, 24 Jan 2013 22:28:28 +0000 (14:28 -0800)
Summary: Currently, we get an exception on empty %Ls for `arc diff --no-ansi` or similar (see P698).

Test Plan: Ran `arc diff --no-ansi`.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D4624

src/workflow/ArcanistDiffWorkflow.php

index 2f3b08bbce93f23560673d1209deada7a24f92b5..3f9ae74e11d10b38a3f1e740fc875b48edee9ec7 100644 (file)
@@ -416,10 +416,18 @@ EOTEXT
         array_unshift($argv, '--ansi');
       }
 
-      $lint_unit = new ExecFuture(
-        'php %s --recon diff --no-diff %Ls',
-        phutil_get_library_root('arcanist').'/../scripts/arcanist.php',
-        $argv);
+      $script = phutil_get_library_root('arcanist').'/../scripts/arcanist.php';
+      if ($argv) {
+        $lint_unit = new ExecFuture(
+          'php %s --recon diff --no-diff %Ls',
+          $script,
+          $argv);
+      } else {
+        $lint_unit = new ExecFuture(
+          'php %s --recon diff --no-diff',
+          $script);
+      }
+
       $lint_unit->write('', true);
       $lint_unit->start();
     }