protected function getCommitHash($hash = null)
    {
        if (!$hash) {
            $gClient = new GitClient(getcwd());
            return $gClient->getHashOfLatestCommit();
        }

        if (strlen($hash) != 40) {
            throw new \InvalidArgumentException(
                sprintf("Invalid git commit hash %s specified", $hash)
            );
        }

        return urlencode($hash);
    }
protected function getCommitHash($hash = null)
    {
        if (!$hash) {
            $gClient = new GitClient(getcwd());
            return $gClient->getHashOfLatestCommit();
        }

        if (strlen($hash) != 40) {
            throw new \InvalidArgumentException(
                sprintf("Invalid git commit hash %s specified", $hash)
            );
        }

        return urlencode($hash);
    }
protected function getCommitHash ( $ hash = null ) { if ( ! $ hash ) { $ gClient = new GitClient ( getcwd ( ) ) ; return $ gClient -> getHashOfLatestCommit ( ) ; } if ( strlen ( $ hash ) != 40 ) { throw new \ InvalidArgumentException ( sprintf ( "Invalid git commit hash %s specified" , $ hash ) ) ; } return urlencode ( $ hash ) ; }
Get Git commit hash of project

@param string $hash Specified hash

@return string       Git commit hash

@throws \InvalidArgumentException    When bad hash specified, or can't get commit hash
Get Git commit hash of project