public function getCommitMessage($file = null)
    {
        if ($file) {
            $hash = null;
            $message = file_get_contents($file);
        } else {
            list($hash, $message) = explode(PHP_EOL, $this->getLastCommitMessage(), 2);
        }

        return new CommitMessage($message, $hash);
    }
public function getCommitMessage($file = null)
    {
        if ($file) {
            $hash = null;
            $message = file_get_contents($file);
        } else {
            list($hash, $message) = explode(PHP_EOL, $this->getLastCommitMessage(), 2);
        }

        return new CommitMessage($message, $hash);
    }
public function getCommitMessage ( $ file = null ) { if ( $ file ) { $ hash = null ; $ message = file_get_contents ( $ file ) ; } else { list ( $ hash , $ message ) = explode ( PHP_EOL , $ this -> getLastCommitMessage ( ) , 2 ) ; } return new CommitMessage ( $ message , $ hash ) ; }
Get a commit message by file or log.

If no file name is provided, the last commit message will be used.

@param  string $file
@return CommitMessage
Get a commit message by file or log .