Skip to content

Commit

Permalink
WIP: Test injecting default branch into new repos
Browse files Browse the repository at this point in the history
  • Loading branch information
ottok committed Jan 12, 2024
1 parent 2d887d7 commit 7bcc0be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gbp/git/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,14 @@ def create(cls, path, description=None, bare=False):
abspath = os.path.abspath(path)

args.add_true(bare, '--bare')

# Git creates new repositories with default branch name 'master' unless
# defined otherwise. To create it with DEP-14 branch name git 2.28.0 or
# newer with --initial-branch is required.
# https://git-scm.com/docs/git-init/2.28.0
args.add('--initial-branch', 'debian/latest')
# @TODO: Replace hard-coded name with options.debian_branch

git_dir = '' if bare else '.git'

try:
Expand Down

0 comments on commit 7bcc0be

Please sign in to comment.