Page MenuHomePhabricator

D9488.diff
No OneTemporary

D9488.diff

diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php
--- a/src/workflow/ArcanistUpgradeWorkflow.php
+++ b/src/workflow/ArcanistUpgradeWorkflow.php
@@ -27,7 +27,11 @@
}
public function getArguments() {
- return array();
+ return array(
+ 'force' => array(
+ 'help' => 'Forces an upgrade, discarding all local commits.',
+ )
+ );
}
public function run() {
@@ -66,11 +70,16 @@
}
chdir($root);
- try {
- phutil_passthru('git pull --rebase');
- } catch (Exception $ex) {
- phutil_passthru('git rebase --abort');
- throw $ex;
+ if ($this->getArgument('force')) {
+ phutil_passthru('git fetch origin master');
+ phutil_passthru('git reset --hard origin/master');
+ } else {
+ try {
+ phutil_passthru('git pull --rebase');
+ } catch (Exception $ex) {
+ phutil_passthru('git rebase --abort');
+ throw $ex;
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 3:50 AM (20 h, 52 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7016812
Default Alt Text
D9488.diff (1 KB)

Event Timeline