From: Nick Harper Date: Sat, 31 Aug 2013 21:57:10 +0000 (-0700) Subject: Don't error on first run of arc diff X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=db3581b8fa56eef0cebcc742fd392a19997f0cc3;p=arcanist.git Don't error on first run of arc diff 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 --- diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php index 1187fd9f..5bf13e8d 100644 --- a/src/workflow/ArcanistDiffWorkflow.php +++ b/src/workflow/ArcanistDiffWorkflow.php @@ -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(