## [Unreleased]
+### Changed
+- Suppress git's init.defaultBranch hints
## [1.4.0] - 2021-06-21
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)
self.tempdir = tempfile.TemporaryDirectory(prefix='git_cache_test-')
self.upstream = os.path.join(self.tempdir.name, 'upstream')
- subprocess.run(['git', 'init', self.upstream], check=True)
+ subprocess.run(['git', '-c', 'init.defaultBranch=master',
+ 'init', self.upstream], check=True)
_commit_file(self.upstream, 'file', 'Contents', 'First commit')
def tearDown(self) -> None: