]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Decide whether to commit or amend with arc diff -a
authorJakub Vrana <jakub@vrana.cz>
Thu, 14 Feb 2013 18:32:30 +0000 (10:32 -0800)
committervrana <jakubv@fb.com>
Thu, 14 Feb 2013 19:56:53 +0000 (11:56 -0800)
Test Plan:
  $ arc diff -a
  $ arc diff -a # saw amend instead of a new commit

Reviewers: epriestley

Reviewed By: epriestley

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

src/workflow/ArcanistBaseWorkflow.php

index 1b3a96bc09622c0fa37cb8a46e8b386576d981a9..421e250669669681d0f3863398ed925912f0edc0 100644 (file)
@@ -916,12 +916,13 @@ abstract class ArcanistBaseWorkflow extends Phobject {
   private function askForAdd() {
     if ($this->commitMode == self::COMMIT_DISABLE) {
       return false;
-    } else if ($this->commitMode == self::COMMIT_ENABLE) {
-      return true;
     }
     if ($this->shouldAmend === null) {
       $this->shouldAmend = $this->shouldAmend();
     }
+    if ($this->commitMode == self::COMMIT_ENABLE) {
+      return true;
+    }
     if ($this->shouldAmend) {
       $prompt = "Do you want to amend these files to the commit?";
     } else {