TQ\Git\Repository\Repository::getCurrentCommit PHP Method

getCurrentCommit() public method

Returns the current commit hash
public getCurrentCommit ( ) : string
return string
    public function getCurrentCommit()
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'rev-parse'}($this->getRepositoryPath(), array('--verify', 'HEAD'));
        $result->assertSuccess(sprintf('Cannot rev-parse "%s"', $this->getRepositoryPath()));
        return $result->getStdOut();
    }