'Obtain the raw text for an object.
:param name: sha for the object.
:return: tuple with numeric type and object contents.'

def get_raw(self, name):

    if (len(name) == 40):
        sha = hex_to_sha(name)
        hexsha = name
    elif (len(name) == 20):
        sha = name
        hexsha = None
    else:
        raise AssertionError(('Invalid    object    name    %r' % name))
    for pack in self.packs:
        try:
            return pack.get_raw(sha)
        except KeyError:
            pass
    if (hexsha is None):
        hexsha = sha_to_hex(name)
    ret = self._get_loose_object(hexsha)
    if (ret is not None):
        return (ret.type_num, ret.as_raw_string())
    for alternate in self.alternates:
        try:
            return alternate.get_raw(hexsha)
        except KeyError:
            pass
    raise KeyError(hexsha)
