File tree 2 files changed +19
-0
lines changed
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::
49
49
.. code-block :: python
50
50
51
51
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):
2811
2811
path = '/projects/%s/fork' % self .get_id ()
2812
2812
self .manager .gitlab .http_delete (path , ** kwargs )
2813
2813
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
+
2814
2829
@cli .register_custom_action ('Project' )
2815
2830
@exc .on_http_error (exc .GitlabCreateError )
2816
2831
def star (self , ** kwargs ):
You can’t perform that action at this time.
0 commit comments