2
0
Эх сурвалжийг харах

Fix serialization of blobs and for header.

Jelmer Vernooij 16 жил өмнө
parent
commit
a47e76db15

+ 4 - 0
dulwich/objects.py

@@ -180,6 +180,8 @@ class ShaFile(object):
         return obj
         return obj
   
   
     def _header(self):
     def _header(self):
+        if self._needs_serialization:
+            self.serialize()
         return "%s %lu\0" % (self._type, len(self._text))
         return "%s %lu\0" % (self._type, len(self._text))
   
   
     def sha(self):
     def sha(self):
@@ -218,6 +220,8 @@ class Blob(ShaFile):
 
 
     _type = BLOB_ID
     _type = BLOB_ID
     _num_type = 3
     _num_type = 3
+    _needs_serialization = False
+    _needs_parsing = False
 
 
     @property
     @property
     def data(self):
     def data(self):