def _put(self, key, data):
        commit = self._create_top_commit()
        commit.message = (
            'Updated key {}'.format(self.subdir + '/' + key)).encode('utf8')

        blob = Blob.from_string(data)

        try:
            parent_commit = self.repo[self._refname]
        except __HOLE__:
            # branch does not exist, start with an empty tree
            tree = Tree()
        else:
            commit.parents = [parent_commit.id]
            tree = self.repo[parent_commit.tree]

        objects_to_add = [blob]

        # no subdirs in filename, add directly to tree
        components = [key.encode('ascii')]
        if self.subdir:
            components = self._subdir_components + components
        res = _on_tree(self.repo, tree, components, blob)
        objects_to_add.extend(res)

        commit.tree = res[-1].id
        objects_to_add.append(commit)

        # add objects
        for obj in objects_to_add:
            self.repo.object_store.add_object(obj)

        # update refs
        self.repo.refs[self._refname] = commit.id

        return key
dataset/ETHPy150Open mbr/simplekv/simplekv/git.py/GitCommitStore._put