'Retrieve a Git object by SHA1 or ref.
:param name: A Git object SHA1 or a ref name
:return: A `ShaFile` object, such as a Commit or Blob
:raise KeyError: when the specified ref or object does not exist'

def __getitem__(self, name):

    if (not isinstance(name, bytes)):
        raise TypeError(("'name'    must    be    bytestring,    not    %.80s" % type(name).__name__))
    if (len(name) in (20, 40)):
        try:
            return self.object_store[name]
        except (KeyError, ValueError):
            pass
    try:
        return self.object_store[self.refs[name]]
    except RefFormatError:
        raise KeyError(name)
