瀏覽代碼

Fix serialization of blobs and for header.

Jelmer Vernooij 16 年之前
父節點
當前提交
a47e76db15
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      dulwich/objects.py

+ 4 - 0
dulwich/objects.py

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