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);
    }