diff --git a/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py b/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py index a0afec63fd..be0dcb0038 100755 --- a/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py +++ b/playbooks/roles/gitea-git-repos/library/gitea_create_repos.py @@ -122,14 +122,23 @@ class Gitea(object): def make_gitea_project(self, project, csrf_token): org, repo = project['project'].split('/', 1) + repo_properties = { + 'auto_init': True, + 'name': repo, + 'description': project.get('description', '')[:255], + # Do not use this functionality until jeepyb can do similar + # for the gerrit side. Once Gerrit and Gitea can be configured + # this could be used on new repos. + # Note we default to master to avoid relying on tool defaults + # as we currently rely on Gitea, Gerrit, and Git to all be in + # sync which may not be the case going forward. + 'default_branch': project.get('default-branch', 'master'), + 'private': False, + 'readme': 'Default', + } resp = self.post( '/api/v1/org/{org}/repos'.format(org=org), - json=dict( - auto_init=True, - description=project.get('description', '')[:255], - name=repo, - private=False, - readme='Default')) + json=repo_properties) self.log("Created repo:", project['project']) def update_gitea_project_settings(self, project, csrf_token):