]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Don't error on first run of arc diff
authorNick Harper <nharper@nharper.org>
Sat, 31 Aug 2013 21:57:10 +0000 (14:57 -0700)
committerNick Harper <nharper@nharper.org>
Sat, 31 Aug 2013 21:57:10 +0000 (14:57 -0700)
Summary:
When running arc diff in a repository that supports commit ranges, it is
possible that the setting for the default relative commit hasn't been set.
If this is the case, the user will be prompted. This change makes sure that
the prompt happens (and thus the setting is set) before we run the
background lint and unit runs.

Test Plan:
```
rm .git/arc/default-relative-commit
arc diff
```

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran
Maniphest Tasks: T2351

Differential Revision: https://secure.phabricator.com/D6854

src/workflow/ArcanistDiffWorkflow.php

index 1187fd9fb3421cf4086832f11a94f303d40a4f2b..5bf13e8d1727cf470cf5c925ac1fcf23c6bd570d 100644 (file)
@@ -433,6 +433,10 @@ EOTEXT
         array_unshift($argv, '--ansi');
       }
 
+      if ($this->getRepositoryAPI()->supportsCommitRanges()) {
+        $this->getRepositoryAPI()->getBaseCommit();
+      }
+
       $script = phutil_get_library_root('arcanist').'/../scripts/arcanist.php';
       if ($argv) {
         $lint_unit = new ExecFuture(