]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Restore kept branch after landing
authorvrana <jakubv@fb.com>
Thu, 7 Feb 2013 02:44:55 +0000 (18:44 -0800)
committervrana <jakubv@fb.com>
Fri, 8 Feb 2013 01:27:34 +0000 (17:27 -0800)
Test Plan: Ran it separately.

Reviewers: epriestley

Reviewed By: epriestley

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

src/workflow/ArcanistLandWorkflow.php

index 79b3e789f0029d79a3088f8e768dab6ca561a05a..fee7fda1c6b1612d277b6152331f24218bbd3404 100644 (file)
@@ -160,10 +160,12 @@ EOTEXT
       $this->cleanupBranch();
     }
 
-    // If we were on some branch A and the user ran "arc land B",
-    // switch back to A.
-    if ($this->oldBranch != $this->branch && $this->oldBranch != $this->onto) {
-      $this->restoreBranch();
+    if ($this->oldBranch != $this->onto) {
+      // If we were on some branch A and the user ran "arc land B",
+      // switch back to A.
+      if ($this->keepBranch || $this->oldBranch != $this->branch) {
+        $this->restoreBranch();
+      }
     }
 
     echo "Done.\n";