diff options
Diffstat (limited to 'tests/component')
-rw-r--r-- | tests/component/__init__.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/component/__init__.py b/tests/component/__init__.py index 6eb74fc4..b509c3b5 100644 --- a/tests/component/__init__.py +++ b/tests/component/__init__.py @@ -137,6 +137,13 @@ class ComponentTestBase(object): (list(extra), list(missing)) assert not extra and not missing, assert_msg + @staticmethod + def ls_tree(repo, treeish): + """List contents (blobs) in a git treeish""" + objs = repo.list_tree(treeish, True) + blobs = [obj[3] for obj in objs if obj[1] == 'blob'] + return set(blobs) + @classmethod def _check_repo_state(cls, repo, current_branch, branches, files=None): """Check that repository is clean and given branches exist""" |