protected function execute(InputInterface $input, OutputInterface $output) { // Check out to an existing branch. $git = new GitRepository($input->getArgument('docroot')); if ($input->getOption('create')) { // Create a new branch, if specified. $git->checkout()->create()->execute($input->getArgument('branch')); } else { $git->checkout()->execute($input->getArgument('branch')); } }
protected function execute(InputInterface $input, OutputInterface $output) { $git = new GitRepository($input->getArgument('docroot')); // Perform the merge. $git->checkout()->execute($input->getArgument('destination')); $git->merge()->execute($input->getArgument('source'), null, '--no-ff'); }
/** * @covers \Bit3\GitPhp\GitRepository::checkout * @covers \Bit3\GitPhp\Command\CheckoutCommandBuilder::execute */ public function testCheckoutOnUninitializedRepository() { $this->setExpectedException('Bit3\\GitPhp\\GitException'); $this->uninitializedGitRepository->checkout()->execute('foo'); }