protected function command($command, $repoPath = null)
    {
        if (!$repoPath) {
            $repoPath = $this->repo;
        }

        $command = 'git --git-dir="'.$repoPath.'/.git" --work-tree="'.$repoPath.'" '.$command;

        exec(escapeshellcmd($command), $output, $returnStatus);

        if ($returnStatus != 0) {
            throw new Exception("The following command was attempted but failed:\r\n$command");
        }

        return $output;
    }
protected function command($command, $repoPath = null)
    {
        if (!$repoPath) {
            $repoPath = $this->repo;
        }

        $command = 'git --git-dir="'.$repoPath.'/.git" --work-tree="'.$repoPath.'" '.$command;

        exec(escapeshellcmd($command), $output, $returnStatus);

        if ($returnStatus != 0) {
            throw new Exception("The following command was attempted but failed:\r\n$command");
        }

        return $output;
    }
protected function command ( $ command , $ repoPath = null ) { if ( ! $ repoPath ) { $ repoPath = $ this -> repo ; } $ command = 'git --git-dir="' . $ repoPath . '/.git" --work-tree="' . $ repoPath . '" ' . $ command ; exec ( escapeshellcmd ( $ command ) , $ output , $ returnStatus ) ; if ( $ returnStatus != 0 ) { throw new Exception ( "The following command was attempted but failed:\r\n$command" ) ; } return $ output ; }
Runs a Git command.

@param string $command
@param null|string $repoPath
@throws Exception if command fails
@return array
Runs a Git command .