diff --git a/src/workflow/ArcanistBaseWorkflow.php b/src/workflow/ArcanistBaseWorkflow.php index e9fcf83d..15031923 100644 --- a/src/workflow/ArcanistBaseWorkflow.php +++ b/src/workflow/ArcanistBaseWorkflow.php @@ -64,6 +64,7 @@ abstract class ArcanistBaseWorkflow { private $repositoryAPI; private $workingCopy; private $arguments; + private $passedArguments; private $command; private $repositoryEncoding; @@ -550,6 +551,10 @@ abstract class ArcanistBaseWorkflow { return idx($this->arguments, $key, $default); } + public function getPassedArguments() { + return $this->passedArguments; + } + final public function getCompleteArgumentSpecification() { $spec = $this->getArguments(); $arc_config = $this->getArcanistConfiguration(); @@ -559,6 +564,7 @@ abstract class ArcanistBaseWorkflow { } public function parseArguments(array $args) { + $this->passedArguments = $args; $spec = $this->getCompleteArgumentSpecification(); diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 5bccc159..9bbe7e7f 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -380,14 +380,14 @@ EOTEXT $background = $this->getArgument('background', !phutil_is_windows()); if ($background) { - $argv = $_SERVER['argv']; - // Insert after `arc diff`. - array_splice($argv, 2, 0, array('--recon', '--no-diff')); + $argv = $this->getPassedArguments(); if (!PhutilConsoleFormatter::getDisableANSI()) { - // Insert after `arc`. - array_splice($argv, 1, 0, array('--ansi')); + array_unshift($argv, '--ansi'); } - $lint_unit = new ExecFuture('php %Ls', $argv); + $lint_unit = new ExecFuture( + 'php %s --recon diff --no-diff %Ls', + phutil_get_library_root('arcanist').'/../scripts/arcanist.php', + $argv); $lint_unit->write('', true); $lint_unit->start(); }