Skip to content

Commit 6b2bf5b

Browse files
author
Jonathan Piron
committed
Fix all kwarg behaviour
`all` kwarg is used to manage GitlabList generator behaviour. However, as it is not poped from kwargs, it is sent to Gitlab API. Some endpoints such as [the project commits](https://docs.gitlab.com/ee/api/commits.html#list-repository-commits) one, support a `all` attribute. This means a call like `project.commits.list(all=True, ref_name='master')` won't return all the master commits as one might expect but all the repository's commits. To prevent confusion, the same kwarg shouldn't be used for 2 distinct purposes. Moreover according to [the documentation](https://python-gitlab.readthedocs.io/en/stable/gl_objects/commits.html#examples), the `all` project commits API endpoint attribute doesn't seem supported.
1 parent 31bca2f commit 6b2bf5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gitlab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def http_list(self, path, query_data={}, as_list=None, **kwargs):
590590
# In case we want to change the default behavior at some point
591591
as_list = True if as_list is None else as_list
592592

593-
get_all = kwargs.get('all', False)
593+
get_all = kwargs.pop('all', False)
594594
url = self._build_url(path)
595595

596596
if get_all is True:

0 commit comments

Comments
 (0)