def get_repo_node(env, repo_name, node):
    try:
        from tracopt.versioncontrol.git.PyGIT import GitError
    except __HOLE__: ## Pre-1.0 Trac
        from tracext.git.PyGIT import GitError
    from trac.core import TracError
    try:
        repo = env.get_repository(reponame=repo_name)
        return repo.get_node(node)
    except GitError:
        raise TracError("Error reading Git files at %s; check your repository path (for repo %s) and file permissions" % (node, repo_name))
dataset/ETHPy150Open boldprogressives/trac-GitolitePlugin/trac_gitolite/utils.py/get_repo_node