@@ -355,13 +355,7 @@ def merge_ref(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
355
355
),
356
356
)
357
357
@exc .on_http_error (exc .GitlabMRClosedError )
358
- def merge (
359
- self ,
360
- merge_commit_message : Optional [str ] = None ,
361
- should_remove_source_branch : Optional [bool ] = None ,
362
- merge_when_pipeline_succeeds : Optional [bool ] = None ,
363
- ** kwargs : Any ,
364
- ) -> Dict [str , Any ]:
358
+ def merge (self , ** kwargs : Any ) -> Dict [str , Any ]:
365
359
"""Accept the merge request.
366
360
367
361
Args:
@@ -377,15 +371,14 @@ def merge(
377
371
GitlabMRClosedError: If the merge failed
378
372
"""
379
373
path = f"{ self .manager .path } /{ self .encoded_id } /merge"
380
- data : Dict [str , Any ] = {}
381
- if merge_commit_message :
382
- data ["merge_commit_message" ] = merge_commit_message
383
- if should_remove_s
9706
ource_branch is not None :
384
- data ["should_remove_source_branch" ] = should_remove_source_branch
385
- if merge_when_pipeline_succeeds is not None :
386
- data ["merge_when_pipeline_succeeds" ] = merge_when_pipeline_succeeds
387
-
388
- server_data = self .manager .gitlab .http_put (path , post_data = data , ** kwargs )
374
+ post_data : Dict [str , Any ] = {}
375
+ data = kwargs .copy ()
376
+
377
+ for key in kwargs .keys ():
378
+ if key in self .merge ._custom_args :
379
+ post_data [key ] = data .pop (key )
380
+
381
+ server_data = self .manager .gitlab .http_put (path , post_data = post_data , ** data )
389
382
if TYPE_CHECKING :
390
383
assert isinstance (server_data , dict )
391
384
self ._update_attrs (server_data )
0 commit comments