def iter_objects(self, object_type: bytes) -> Iterator[ShaFile]: """Read all the objects of type `object_type` from the packfile""" if self.dumb: yield from self.dumb_fetcher.iter_objects(object_type) else: self.pack_buffer.seek(0) count = 0 for obj in PackInflater.for_pack_data( PackData.from_file(self.pack_buffer, self.pack_size) ): if obj.type_name != object_type: continue yield obj count += 1 logger.debug("packfile_read_count_%s=%s", object_type.decode(), count)
def commit(): p = PackData.from_file(BytesIO(f.getvalue()), f.tell()) f.close() for obj in PackInflater.for_pack_data(p, self.get_raw): self.add_object(obj)
def commit(): p = PackData.from_file(StringIO(f.getvalue()), f.tell()) f.close() for obj in PackInflater.for_pack_data(p): self._data[obj.id] = obj
def commit(): p = PackData.from_file(BytesIO(f.getvalue()), f.tell()) f.close() for obj in PackInflater.for_pack_data(p): self._data[obj.id] = obj
def store(): p = PackData.from_file(StringIO(fileContents.getvalue()), fileContents.tell()) for obj in PackInflater.for_pack_data(p): self.add_object(obj)
def commit(): p = PackData.from_file(StringIO(f.getvalue()), f.tell()) f.close() self.add_objects([obj for obj in PackInflater.for_pack_data(p)])