]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Handle `arc diff --background 1 --`
authorvrana <jakubv@fb.com>
Sat, 15 Sep 2012 01:46:33 +0000 (18:46 -0700)
committervrana <jakubv@fb.com>
Mon, 17 Sep 2012 20:20:31 +0000 (13:20 -0700)
Summary: We currently insert background parameters to end which causes ignoring them if there is '--'.

Test Plan:
  $ arc diff --background 1 -- HEAD^

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D3497

src/workflow/ArcanistDiffWorkflow.php

index 1c2a8055420570a5181327889e1817ddc4e92e32..441b0f741ea0268c206a3f08442c13a6f94968d5 100644 (file)
@@ -373,10 +373,13 @@ EOTEXT
 
     if ($this->getArgument('background')) {
       $argv = $_SERVER['argv'];
+      // Insert after `arc diff`.
+      array_splice($argv, 2, 0, array('--recon', '--no-diff'));
       if (!PhutilConsoleFormatter::getDisableANSI()) {
-        $argv[] = '--ansi';
+        // Insert after `arc`.
+        array_splice($argv, 1, 0, array('--ansi'));
       }
-      $lint_unit = new ExecFuture('%Ls --recon --no-diff', $argv);
+      $lint_unit = new ExecFuture('%Ls', $argv);
       $lint_unit->write('', true);
       $lint_unit->start();
     }