public function merge(Branch $with, $message = '', Array $options = array())
    {
        if (in_array(self::MERGE_OPTION_FF_ONLY, $options) && in_array(self::MERGE_OPTION_NO_FF, $options)) {
            throw new \Symfony\Component\Process\Exception\InvalidArgumentException("Invalid options: cannot use flags --ff-only and --no-ff together.");
        }
        $normalizedOptions = $this->normalizeOptions($options, $this->mergeCmdSwitchOptions());

        $this->clearAll();
        $this->addCommandName(static::MERGE_COMMAND);

        foreach ($normalizedOptions as $value) {
            $this->addCommandArgument($value);
        }

        if (!empty($message)) {
            $this->addCommandArgument('-m');
            $this->addCommandArgument($message);
        }

        $this->addCommandSubject($with->getFullRef());

        return $this->getCommand();
    }
public function merge(Branch $with, $message = '', Array $options = array())
    {
        if (in_array(self::MERGE_OPTION_FF_ONLY, $options) && in_array(self::MERGE_OPTION_NO_FF, $options)) {
            throw new \Symfony\Component\Process\Exception\InvalidArgumentException("Invalid options: cannot use flags --ff-only and --no-ff together.");
        }
        $normalizedOptions = $this->normalizeOptions($options, $this->mergeCmdSwitchOptions());

        $this->clearAll();
        $this->addCommandName(static::MERGE_COMMAND);

        foreach ($normalizedOptions as $value) {
            $this->addCommandArgument($value);
        }

        if (!empty($message)) {
            $this->addCommandArgument('-m');
            $this->addCommandArgument($message);
        }

        $this->addCommandSubject($with->getFullRef());

        return $this->getCommand();
    }
public function merge ( Branch $ with , $ message = '' , Array $ options = array ( ) ) { if ( in_array ( self :: MERGE_OPTION_FF_ONLY , $ options ) && in_array ( self :: MERGE_OPTION_NO_FF , $ options ) ) { throw new \ Symfony \ Component \ Process \ Exception \ InvalidArgumentException ( "Invalid options: cannot use flags --ff-only and --no-ff together." ) ; } $ normalizedOptions = $ this -> normalizeOptions ( $ options , $ this -> mergeCmdSwitchOptions ( ) ) ; $ this -> clearAll ( ) ; $ this -> addCommandName ( static :: MERGE_COMMAND ) ; foreach ( $ normalizedOptions as $ value ) { $ this -> addCommandArgument ( $ value ) ; } if ( ! empty ( $ message ) ) { $ this -> addCommandArgument ( '-m' ) ; $ this -> addCommandArgument ( $ message ) ; } $ this -> addCommandSubject ( $ with -> getFullRef ( ) ) ; return $ this -> getCommand ( ) ; }
Generate a merge command

@param \GitElephant\Objects\Branch $with    the branch to merge
@param string                      $message a message for the merge commit, if merge is 3-way
@param array                       $options option flags for git merge

@throws \RuntimeException
@return string
Generate a merge command