@public<EOL>def get_default_ref(repo):
assert isinstance(repo, github.Repository.Repository), type(repo)<EOL>default_branch = repo.default_branch<EOL>default_branch_ref = "<STR_LIT>".format(ref=default_branch)<EOL>try:<EOL><INDENT>head = repo.get_git_ref(default_branch_ref)<EOL><DEDENT>except github.RateLimitExceededException:<EOL><INDENT>raise<EOL><DEDENT>except github.GithubException as e:<EOL><INDENT>msg = "<STR_LIT>".format(ref=default_branch_ref)<EOL>raise CaughtRepositoryError(repo, e, msg) from None<EOL><DEDENT>return head<EOL>
Return a `github.GitRef` object for the HEAD of the default branch.

    Parameters
    ----------
    repo: github.Repository.Repository
        repo to get default branch head ref from

    Returns
    -------
    head : :class:`github.GitRef` instance

    Raises
    ------
    github.RateLimitExceededException
    codekit.pygithub.CaughtRepositoryError