From: vrana Date: Tue, 29 Jan 2013 01:05:09 +0000 (-0800) Subject: Reset master after unsuccessful push X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c45053da4cb8c585f0814e079a5c5d391e184228;p=arcanist.git Reset master after unsuccessful push Test Plan: None. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4717 --- 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."); }