Summary: You can get this out of reflog, but we can easily just give you the
command in case you want to undo the -D.
Test Plan: Ran "arc land --hold" on this branch, used recovery command to
recover it.
Reviewers: cpiro, btrahan, jungejason
Reviewed By: cpiro
CC: aran, epriestley
Differential Revision: https://secure.phabricator.com/D1504
}
if (!$this->getArgument('keep-branch')) {
+ list($ref) = execx(
+ '(cd %s && git rev-parse --verify %s)',
+ $repository_api->getPath(),
+ $branch);
+ $ref = trim($ref);
+ $recovery_command = csprintf(
+ 'git checkout -b %s %s',
+ $branch,
+ $ref);
+
echo "Cleaning up feature branch...\n";
+ echo "(Use `{$recovery_command}` if you want it back.)\n";
execx(
'(cd %s && git branch -D %s)',
$repository_api->getPath(),
phutil_require_module('phutil', 'console');
phutil_require_module('phutil', 'future/exec');
phutil_require_module('phutil', 'utils');
+phutil_require_module('phutil', 'xsprintf/csprintf');
phutil_require_source('ArcanistLandWorkflow.php');