summaryrefslogtreecommitdiff
path: root/lib/git/objects/tree.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-27 11:57:21 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-27 11:57:21 +0100
commit7ba46b8fba511fdc9b8890c36a6d941d9f2798fe (patch)
tree1c726c6a9478c834e88bb4fd05b5657929becb4f /lib/git/objects/tree.py
parent2740d2cf960cec75e0527741da998bf3c28a1a45 (diff)
downloadgitpython-7ba46b8fba511fdc9b8890c36a6d941d9f2798fe.tar.gz
Fixed issue with commit traversal due to missing visit_once in the traversal method, improved code performance by disabling the visit-once flag by default for trees, which by nature are not recursive
Diffstat (limited to 'lib/git/objects/tree.py')
-rw-r--r--lib/git/objects/tree.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py
index e6fa3f18..c80450fc 100644
--- a/lib/git/objects/tree.py
+++ b/lib/git/objects/tree.py
@@ -181,6 +181,14 @@ class Tree(base.IndexObject, diff.Diffable, utils.Traversable):
return [ i for i in self if i.type == "blob" ]
+ def traverse( self, predicate = lambda i,d: True,
+ prune = lambda i,d: False, depth = -1, branch_first=True,
+ visit_once = False, ignore_self=1 ):
+ """For documentation, see utils.Traversable.traverse
+
+ Trees are set to visist_once = False to gain more performance in the traversal"""
+ return super(Tree, self).traverse(predicate, prune, depth, branch_first, visit_once, ignore_self)
+
# List protocol
def __getslice__(self,i,j):
return self._cache[i:j]