]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve 'arc land' in immutable workflows
authorepriestley <git@epriestley.com>
Fri, 27 Jan 2012 01:41:11 +0000 (17:41 -0800)
committerepriestley <git@epriestley.com>
Fri, 27 Jan 2012 01:41:11 +0000 (17:41 -0800)
Summary: Better instructions in the 'git merge' failure case for 'arc land'.

Test Plan: no you test

Reviewers: fratrik, btrahan, jungejason

Reviewed By: fratrik

CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1500

src/workflow/land/ArcanistLandWorkflow.php

index 0e7e09f883bd1b281d7c9fc87a71e226f79d4628..59123fa6648d8a4ef358aa7f936f56a9132f9522 100644 (file)
@@ -217,11 +217,17 @@ EOTEXT
     if ($is_immutable) {
       // In immutable histories, do a --no-ff merge to force a merge commit with
       // the right message.
-      execx(
+      $err = phutil_passthru(
         '(cd %s && git merge --no-ff -m %s %s)',
         $repository_api->getPath(),
         $message,
         $branch);
+      if ($err) {
+        throw new ArcanistUsageException(
+          "'git merge' failed. Your working copy has been left in a partially ".
+          "merged state. You can: abort with 'git merge --abort'; or follow ".
+          "the instructions to complete the merge, and then push.");
+      }
     } else {
       // In mutable histories, do a --squash merge.
       execx(