示例#1
0
 protected function run(\DialoGit\Dialoger $dialoger)
 {
     $picker = new \DialoGit\Picker\Branch($dialoger);
     $currentBranch = $picker->getCurrent();
     $branch = $picker->pickOneBut('HEAD is on <b>' . $currentBranch . '</b>\\n\\nPick one branch to <b>checkout</b>:', $currentBranch);
     $dialoger->runGit('checkout ' . $branch);
     $dialoger->dialogInfo('HEAD is now on branch <b>' . $branch . '</b>');
 }
示例#2
0
 protected function run(\DialoGit\Dialoger $dialoger)
 {
     $picker = new \DialoGit\Picker\Branch($dialoger);
     $branches = $picker->getStructures();
     if (count($branches) == 1) {
         $dialoger->dialogError('There is only one local branch right now.');
         $dialoger->error();
     }
     $currentBranch = $picker->getCurrent();
     if ($picker->isHeadOnBranch()) {
         $branch = $picker->pickOneBut('HEAD is on <b>' . $currentBranch . '</b>\\n\\nPick one local branch to <b>merge</b> with:', $currentBranch);
         $dialoger->dialogConfirm('Do you want to modify <b>' . $currentBranch . '</b> by merging the contents of <b>' . $branch . '</b> into it?');
         $dialoger->runGit('merge ' . $branch);
     } else {
         $dialoger->dialogError('Merge requires HEAD to be on a branch, but HEAD is on <b>' . $currentBranch . '</b>, which is not a branch.');
         $dialoger->error();
     }
 }