Gush\Command\Branch\BranchForkCommand::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $sourceOrg = $input->getOption('org');
        $repo = $input->getOption('repo');
        $targetOrg = $input->getArgument('target_organization');
        if (null === $targetOrg) {
            $targetOrg = $this->getParameter($input, 'authentication')['username'];
        }
        $fork = $this->getAdapter()->createFork($targetOrg);
        $this->getHelper('gush_style')->success(sprintf('Forked repository %s/%s into %s/%s', $sourceOrg, $repo, $targetOrg, $repo));
        /** @var GitConfigHelper $gitConfigHelper */
        $gitConfigHelper = $this->getHelper('git_config');
        $gitConfigHelper->setRemote($targetOrg, $fork['git_url']);
        $this->getHelper('gush_style')->success(sprintf('Added remote "%s" with "%s".', $targetOrg, $fork['git_url']));
        return self::COMMAND_SUCCESS;
    }
BranchForkCommand