X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/004804f0d1ef301076ea6c8a5b7d0287d096fca1..21971f7fbf702a0e9e35a3716b999ade7d02dd34:/git_cache.py diff --git a/git_cache.py b/git_cache.py index d54041b..1ed2601 100644 --- a/git_cache.py +++ b/git_cache.py @@ -176,8 +176,14 @@ def fetch(repo: Repo, ref: Ref, force: bool = False) -> Tuple[Path, Rev]: 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)