def get_tree(repo, sha):
    try:
        obj = repo[unicode(sha)]
    except __HOLE__:
        raise NotFound("tree not found")
    if obj.type == GIT_OBJ_TREE:
        return obj
    elif obj.type == GIT_OBJ_COMMIT:
        return obj.tree
    elif obj.type == GIT_OBJ_TAG:
        obj = repo[obj.target]
        if obj.type == GIT_OBJ_TAG:
            return get_tree(repo, obj.target)
        else:
            return obj.tree
    else:
        raise NotFound("object not a tree, a commit or a tag")
dataset/ETHPy150Open hulu/restfulgit/restfulgit/plumbing/retrieval.py/get_tree