From c2f8f0e7db9529e1f1f32d790a67d1e20d2fe052 Mon Sep 17 00:00:00 2001 From: Jonathan Vogt Date: Mon, 15 Feb 2021 13:55:14 +0100 Subject: fix: honor parameter value passed Gitlab allows setting the defaults for MR to delete the source. Also the inline help of the CLI suggest that a boolean is expected, but no matter what value you set, it will always delete. --- gitlab/v4/objects/merge_requests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gitlab') diff --git a/gitlab/v4/objects/merge_requests.py b/gitlab/v4/objects/merge_requests.py index dd37ada..f6c5611 100644 --- a/gitlab/v4/objects/merge_requests.py +++ b/gitlab/v4/objects/merge_requests.py @@ -312,8 +312,8 @@ class ProjectMergeRequest( data = {} if merge_commit_message: data["merge_commit_message"] = merge_commit_message - if should_remove_source_branch: - data["should_remove_source_branch"] = True + 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 -- cgit v1.2.1