'Add a single object to this object store.
:param obj: Object to add'

def add_object(self, obj):

    path = self._get_shafile_path(obj.id)
    dir = os.path.dirname(path)
    try:
        os.mkdir(dir)
    except OSError as e:
        if (e.errno != errno.EEXIST):
            raise
    if os.path.exists(path):
        return
    with GitFile(path, 'wb') as f:
        f.write(obj.as_legacy_object())
