From c45053da4cb8c585f0814e079a5c5d391e184228 Mon Sep 17 00:00:00 2001 From: vrana Date: Mon, 28 Jan 2013 17:05:09 -0800 Subject: [PATCH] Reset master after unsuccessful push Test Plan: None. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4717 --- src/workflow/ArcanistLandWorkflow.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/workflow/ArcanistLandWorkflow.php b/src/workflow/ArcanistLandWorkflow.php index 772233a4..0839aaf8 100644 --- a/src/workflow/ArcanistLandWorkflow.php +++ b/src/workflow/ArcanistLandWorkflow.php @@ -762,6 +762,12 @@ EOTEXT if ($err) { echo phutil_console_format("** PUSH FAILED! **\n"); + if ($this->isGit) { + $repository_api->execxLocal('reset --hard HEAD^'); + $this->restoreBranch(); + throw new ArcanistUsageException( + "'{$cmd}' failed! Fix the error and run 'arc land' again."); + } throw new ArcanistUsageException( "'{$cmd}' failed! Fix the error and push this change manually."); }