summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-01-08 15:07:25 -0800
committerJohn L. Villalovos <john@sodarock.com>2022-01-08 15:07:25 -0800
commit8e589c43fa2298dc24b97423ffcc0ce18d911e3b (patch)
tree01ce072db38de16e3fd28e4c4539160cb9a13720 /gitlab/v4/objects
parent22a151695373ead50ede5cc623130c39bfe1030e (diff)
downloadgitlab-8e589c43fa2298dc24b97423ffcc0ce18d911e3b.tar.gz
fix: remove default arguments for mergerequests.merge()
The arguments `should_remove_source_branch` and `merge_when_pipeline_succeeds` are optional arguments. We should not be setting any default value for them. https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr Closes: #1750
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/merge_requests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py
index 11c962b..0e81de1 100644
--- a/gitlab/v4/objects/merge_requests.py
+++ b/gitlab/v4/objects/merge_requests.py
@@ -358,8 +358,8 @@ class ProjectMergeRequest(
def merge(
self,
merge_commit_message: Optional[str] = None,
- should_remove_source_branch: bool = False,
- merge_when_pipeline_succeeds: bool = False,
+ should_remove_source_branch: Optional[bool] = None,
+ merge_when_pipeline_succeeds: Optional[bool] = None,
**kwargs: Any,
) -> Dict[str, Any]:
"""Accept the merge request.
@@ -382,8 +382,8 @@ class ProjectMergeRequest(
data["merge_commit_message"] = merge_commit_message
if should_remove_source_branch is not None:
data["should_remove_source_branch"] = should_remove_source_branch
- if merge_when_pipeline_succeeds:
- data["merge_when_pipeline_succeeds"] = True
+ if merge_when_pipeline_succeeds is not None:
+ data["merge_when_pipeline_succeeds"] = merge_when_pipeline_succeeds
server_data = self.manager.gitlab.http_put(path, post_data=data, **kwargs)
if TYPE_CHECKING: