git.samba.org
/
jelmer
/
dulwich-libgit2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Implement Tree.__len__.
[jelmer/dulwich-libgit2.git]
/
dulwich
/
objects.py
diff --git
a/dulwich/objects.py
b/dulwich/objects.py
index f9273818bcc2110bbfd1307ee799e9aabdbe3458..01193d8ce8bd5cb09495211662d03e9b7df7d15f 100644
(file)
--- a/
dulwich/objects.py
+++ b/
dulwich/objects.py
@@
-428,6
+428,9
@@
class Tree(ShaFile):
del self._entries[name]
self._needs_serialization = True
+ def __len__(self):
+ return len(self._entries)
+
def add(self, mode, name, hexsha):
assert type(mode) == int
assert type(name) == str