summaryrefslogtreecommitdiff
path: root/test/git/test_tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/git/test_tree.py')
-rw-r--r--test/git/test_tree.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/git/test_tree.py b/test/git/test_tree.py
index dafb6f3f..b359e2d2 100644
--- a/test/git/test_tree.py
+++ b/test/git/test_tree.py
@@ -35,6 +35,11 @@ class TestTree(TestCase):
trees = list(root.traverse(predicate = trees_only))
assert len(trees) == len(list( i for i in root.traverse() if trees_only(i) ))
+ # test prune
+ lib_folder = lambda t: t.path == "lib"
+ pruned_trees = list(root.traverse(predicate = trees_only,prune = lib_folder))
+ assert len(pruned_trees) < len(trees)
+
# trees and blobs
assert len(set(trees)|set(root.trees)) == len(trees)
assert len(set(b for b in root if isinstance(b, Blob)) | set(root.blobs)) == len( root.blobs )