summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-03-08 19:16:44 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2018-03-08 19:16:44 +0100
commitd35a31d1268c6c8edb9f8b8322c5c66cb70ea9ae (patch)
tree622a525f2d6ec9d6290f57e9d2d31628fbff722d /gitlab/v4/objects.py
parent748d57ee64036305a84301db7211b713c1995391 (diff)
downloadgitlab-d35a31d1268c6c8edb9f8b8322c5c66cb70ea9ae.tar.gz
Add support for recursive tree listing
Fixes #452
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r--gitlab/v4/objects.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 80a6ca5..4ca9dea 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -2403,12 +2403,13 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
@cli.register_custom_action('Project', tuple(), ('path', 'ref'))
@exc.on_http_error(exc.GitlabGetError)
- def repository_tree(self, path='', ref='', **kwargs):
+ def repository_tree(self, path='', ref='', recursive=False, **kwargs):
"""Return a list of files in the repository.
Args:
path (str): Path of the top folder (/ by default)
ref (str): Reference to a commit or branch
+ recursive (bool): Whether to get the tree recursively
all (bool): If True, return all the items, without pagination
per_page (int): Number of items to retrieve per request
page (int): ID of the page to return (starts with page 1)
@@ -2424,7 +2425,7 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
list: The representation of the tree
"""
gl_path = '/projects/%s/repository/tree' % self.get_id()
- query_data = {}
+ query_data = {'recursive': recursive}
if path:
query_data['path'] = path
if ref: