Browse Source

ensure a tree is parsed before calculating its length

Abderrahim Kitouni 16 năm trước cách đây
mục cha
commit
3c9897789f
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      dulwich/objects.py

+ 1 - 0
dulwich/objects.py

@@ -430,6 +430,7 @@ class Tree(ShaFile):
         self._needs_serialization = True
 
     def __len__(self):
+        self._ensure_parsed()
         return len(self._entries)
 
     def add(self, mode, name, hexsha):