From aec212069e5699663ed6487b616279b1b6c08b48 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 24 Jan 2013 14:28:28 -0800 Subject: [PATCH] Fix `arc diff --no-ansi` 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 2f3b08bb..3f9ae74e 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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(); }