Pārlūkot izejas kodu

ensure a tree is parsed before calculating its length

Abderrahim Kitouni 16 gadi atpakaļ
vecāks
revīzija
9b924dd869
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  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):