cachedir = git_cachedir(repo)
if not os.path.exists(cachedir):
logging.debug("Initializing git repo")
- subprocess.run(['git', 'init', '--bare', cachedir],
- check=True, stdout=sys.stderr)
+ subprocess.run(['git',
+ '-c',
+ 'init.defaultBranch=git-cache--no-default-branch',
+ 'init',
+ '--bare',
+ cachedir],
+ check=True,
+ stdout=sys.stderr)
logging.debug('Fetching ref "%s" from %s', ref, repo)
_git_fetch(cachedir, repo, ref, force=force)