File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -49,3 +49,7 @@ Protect/unprotect a repository branch::
4949 .. code-block :: python
5050
5151 branch.protect(developers_can_push = True , developers_can_merge = True )
52+
53+ Delete the merged branches for a project::
54+
55+ project.delete_merged_branches()
Original file line number Diff line number Diff line change @@ -2811,6 +2811,21 @@ def delete_fork_relation(self, **kwargs):
28112811 path = '/projects/%s/fork' % self .get_id ()
28122812 self .manager .gitlab .http_delete (path , ** kwargs )
28132813
2814+ @cli .register_custom_action ('Project' )
2815+ @exc .on_http_error (exc .GitlabDeleteError )
2816+ def delete_merged_branches (self , ** kwargs ):
2817+ """Delete merged branches.
2818+
2819+ Args:
2820+ **kwargs: Extra options to send to the server (e.g. sudo)
2821+
2822+ Raises:
2823+ GitlabAuthenticationError: If authentication is not correct
2824+ GitlabDeleteError: If the server failed to perform the request
2825+ """
2826+ path = '/projects/%s/repository/merged_branches' % self .get_id ()
2827+ self .manager .gitlab .http_delete (path , ** kwargs )
2828+
28142829 @cli .register_custom_action ('Project' )
28152830 @exc .on_http_error (exc .GitlabCreateError )
28162831 def star (self , ** kwargs ):
You can’t perform that action at this time.
0 commit comments