Explorar o código

ensure a tree is parsed before calculating its length

Abderrahim Kitouni %!s(int64=15) %!d(string=hai) anos
pai
achega
3c9897789f
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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):