浏览代码

Always initialize _sha.

Jelmer Vernooij 16 年之前
父节点
当前提交
603cd5a5dd
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      dulwich/objects.py

+ 3 - 0
dulwich/objects.py

@@ -158,6 +158,7 @@ class ShaFile(object):
   
     def __init__(self):
         """Don't call this directly"""
+        self._sha = None
   
     def _parse_text(self):
         """For subclasses to do initialisation time parsing"""
@@ -386,6 +387,7 @@ class Tree(ShaFile):
     _num_type = 2
 
     def __init__(self):
+        super(Tree, self).__init__()
         self._entries = {}
         self._needs_parsing = False
         self._needs_serialization = True
@@ -475,6 +477,7 @@ class Commit(ShaFile):
     _num_type = 1
 
     def __init__(self):
+        super(Commit, self).__init__()
         self._parents = []
         self._needs_parsing = False
         self._needs_serialization = True