Skip to content

Commit

Permalink
ensure a tree is parsed before calculating its length
Browse files Browse the repository at this point in the history
  • Loading branch information
abderrahim committed Jul 28, 2009
1 parent b3edb70 commit 3c98977
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dulwich/objects.py
Expand Up @@ -430,6 +430,7 @@ def __delitem__(self, name):
self._needs_serialization = True

def __len__(self):
self._ensure_parsed()
return len(self._entries)

def add(self, mode, name, hexsha):
Expand Down

0 comments on commit 3c98977

Please sign in to comment.