public function diff($of, $with = null, $path = null)
    {
        $this->clearAll();
        $this->addCommandName(self::DIFF_COMMAND);
        // Instead of the first handful of characters, show the full pre- and post-image blob object names on the
        // "index" line when generating patch format output
        $this->addCommandArgument('--full-index');
        $this->addCommandArgument('--no-color');
        // Disallow external diff drivers
        $this->addCommandArgument('--no-ext-diff');
        // Detect renames
        $this->addCommandArgument('-M');
        $this->addCommandArgument('--dst-prefix=DST/');
        $this->addCommandArgument('--src-prefix=SRC/');

        $subject = '';

        if (is_null($with)) {
            $subject .= $of.'^..'.$of;
        } else {
            $subject .= $with.'..'.$of;
        }

        if (! is_null($path)) {
            if (!is_string($path)) {
                /** @var Object $path */
                $path = $path->getPath();
            }
            $this->addPath($path);
        }

        $this->addCommandSubject($subject);

        return $this->getCommand();
    }
public function diff($of, $with = null, $path = null)
    {
        $this->clearAll();
        $this->addCommandName(self::DIFF_COMMAND);
        // Instead of the first handful of characters, show the full pre- and post-image blob object names on the
        // "index" line when generating patch format output
        $this->addCommandArgument('--full-index');
        $this->addCommandArgument('--no-color');
        // Disallow external diff drivers
        $this->addCommandArgument('--no-ext-diff');
        // Detect renames
        $this->addCommandArgument('-M');
        $this->addCommandArgument('--dst-prefix=DST/');
        $this->addCommandArgument('--src-prefix=SRC/');

        $subject = '';

        if (is_null($with)) {
            $subject .= $of.'^..'.$of;
        } else {
            $subject .= $with.'..'.$of;
        }

        if (! is_null($path)) {
            if (!is_string($path)) {
                /** @var Object $path */
                $path = $path->getPath();
            }
            $this->addPath($path);
        }

        $this->addCommandSubject($subject);

        return $this->getCommand();
    }
public function diff ( $ of , $ with = null , $ path = null ) { $ this -> clearAll ( ) ; $ this -> addCommandName ( self :: DIFF_COMMAND ) ; // Instead of the first handful of characters, show the full pre- and post-image blob object names on the // "index" line when generating patch format output $ this -> addCommandArgument ( '--full-index' ) ; $ this -> addCommandArgument ( '--no-color' ) ; // Disallow external diff drivers $ this -> addCommandArgument ( '--no-ext-diff' ) ; // Detect renames $ this -> addCommandArgument ( '-M' ) ; $ this -> addCommandArgument ( '--dst-prefix=DST/' ) ; $ this -> addCommandArgument ( '--src-prefix=SRC/' ) ; $ subject = '' ; if ( is_null ( $ with ) ) { $ subject .= $ of . '^..' . $ of ; } else { $ subject .= $ with . '..' . $ of ; } if ( ! is_null ( $ path ) ) { if ( ! is_string ( $ path ) ) { /** @var Object $path */ $ path = $ path -> getPath ( ) ; } $ this -> addPath ( $ path ) ; } $ this -> addCommandSubject ( $ subject ) ; return $ this -> getCommand ( ) ; }
build a diff command

@param TreeishInterface      $of   the reference to diff
@param TreeishInterface|null $with the source reference to diff with $of, if not specified is the current HEAD
@param null                  $path the path to diff, if not specified the full repository

@throws \RuntimeException
@return string
build a diff command