'Create a new bare repository in memory.
:param objects: Objects for the new repository,
as iterable
:param refs: Refs as dictionary, mapping names
to object SHA1s'

@classmethod
def init_bare(cls, objects, refs):

    ret = cls()
    for obj in objects:
        ret.object_store.add_object(obj)
    for (refname, sha) in refs.items():
        ret.refs[refname] = sha
    ret._init_files(bare=True)
    return ret
