X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/083b90e7f36d292909d0ce573e3681ddfb011a77..21971f7fbf702a0e9e35a3716b999ade7d02dd34:/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)