Return a git.Tree object matching a SHA

def get_tree_from_sha(self, ref):
        '''
        Return a git.Tree object matching a SHA
        '''
        try:
            return self.repo.rev_parse(ref).tree
        except (gitdb.exc.ODBError, AttributeError):
            return None