File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -788,6 +788,7 @@ def create_repository(
788
788
auto_init = False ,
789
789
gitignore_template = "" ,
790
790
has_projects = True ,
791
+ delete_branch_on_merge = False ,
791
792
):
792
793
"""Create a repository for the authenticated user.
793
794
@@ -816,6 +817,9 @@ def create_repository(
816
817
:param bool has_projects:
817
818
(optional), If ``True``, enable projects for this repository. API
818
819
default: ``True``
820
+ :param bool delete_branch_on_merge:
821
+ (optional) If ``True``, head branches will automatically be deleted
822
+ when pull requests are merged. API default: ``False``
819
823
:returns:
820
824
created repository
821
825
:rtype:
@@ -832,6 +836,7 @@ def create_repository(
832
836
"auto_init" : auto_init ,
833
837
"gitignore_template" : gitignore_template ,
834
838
"has_projects" : has_projects ,
839
+ "delete_branch_on_merge" : delete_branch_on_merge ,
835
840
}
836
841
json = self ._json (self ._post (url , data = data ), 201 )
837
842
return self ._instance_or_null (repo .Repository , json )
Original file line number Diff line number Diff line change @@ -623,6 +623,7 @@ def create_repository(
623
623
gitignore_template = "" ,
624
624
license_template = "" ,
625
625
has_projects = True ,
626
+ delete_branch_on_merge = False ,
626
627
):
627
628
"""Create a repository for this organization.
628
629
@@ -662,6 +663,9 @@ def create_repository(
662
663
:param bool has_projects:
663
664
(optional), If ``True``, enable projects for this repository. API
664
665
default: ``True``
666
+ :param bool delete_branch_on_merge:
667
+ (optional) If ``True``, head branches will automatically be deleted
668
+ when pull requests are merged. API default: ``False``
665
669
:returns:
666
670
the created repository
667
671
:rtype:
@@ -679,6 +683,7 @@ def create_repository(
679
683
"auto_init" : auto_init ,
680
684
"gitignore_template" : gitignore_template ,
681
685
"has_projects" : has_projects ,
686
+ "delete_branch_on_merge" : delete_branch_on_merge ,
682
687
}
683
688
if int (team_id ) > 0 :
684
689
data .update ({"team_id" : team_id })
You can’t perform that action at this time.
0 commit comments