+@backoff.on_exception(
+ backoff.expo,
+ subprocess.CalledProcessError,
+ max_time=lambda: int(os.environ.get('BACKOFF_MAX_TIME', '30')))
+def _git_fetch(cachedir: Path, repo: Repo, ref: Ref) -> None:
+ # We don't use --force here because we want to abort and freak out if forced
+ # updates are happening.
+ subprocess.run(['git', '-C', cachedir, 'fetch', repo,
+ '%s:%s' % (ref, ref)], check=True)
+
+