X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/083b90e7f36d292909d0ce573e3681ddfb011a77..c143afb995bcc31aa3720647aa7d641d4e171d53:/git_cache.py diff --git a/git_cache.py b/git_cache.py index b0f992e..1ed2601 100644 --- a/git_cache.py +++ b/git_cache.py @@ -156,7 +156,6 @@ def _show_force_warning() -> None: print('*' * 74, file=sys.stderr) - @backoff.on_exception( backoff.expo, subprocess.CalledProcessError, @@ -177,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)