def add_object(self, wire, content): repo_init = self._factory.repo_libgit2(wire) with repo_init as repo: blob = objects.Blob() blob.set_raw_string(content) repo.object_store.add_object(blob) return blob.id
def _add_file(repo, tree_id, filename, contents): tree = repo[tree_id] blob = objects.Blob() blob.data = contents.encode("utf-8") repo.object_store.add_object(blob) tree.add(filename.encode("utf-8"), stat.S_IFREG | 0o644, blob.id) repo.object_store.add_object(tree) return tree.id
def add_object(self, wire, content): repo = self._factory.repo(wire) blob = objects.Blob() blob.set_raw_string(content) repo.object_store.add_object(blob) return blob.id