X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/004804f0d1ef301076ea6c8a5b7d0287d096fca1..c143afb995bcc31aa3720647aa7d641d4e171d53:/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)