示例#1
0
 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)
示例#3
0
 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
示例#4
0
 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)
示例#5
0
 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
示例#6
0
		def store():
			p = PackData.from_file(StringIO(fileContents.getvalue()), fileContents.tell())
			for obj in PackInflater.for_pack_data(p):
				self.add_object(obj)
示例#7
0
 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)])