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(); } }