mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
git_cache: wrap "git remote show" call in retries
BUG=b:236709670 TEST=none Change-Id: I575dd82260acdbeef3c4c7607e2c2ac8020a44c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3749247 Commit-Queue: Jack Neus <jackneus@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
@@ -423,9 +423,11 @@ class Mirror(object):
|
||||
# Start with a bare git dir.
|
||||
self.RunGit(['init', '--bare'], cwd=self.mirror_path)
|
||||
# Set appropriate symbolic-ref
|
||||
remote_info = subprocess.check_output(
|
||||
[self.git_exe, 'remote', 'show', self.url],
|
||||
cwd=self.mirror_path).decode('utf-8', 'ignore').strip()
|
||||
remote_info = exponential_backoff_retry(
|
||||
lambda: subprocess.check_output(
|
||||
[self.git_exe, 'remote', 'show', self.url],
|
||||
cwd=self.mirror_path).decode('utf-8', 'ignore').strip()
|
||||
)
|
||||
default_branch_regexp = re.compile(r'HEAD branch: (.*)$')
|
||||
m = default_branch_regexp.search(remote_info, re.MULTILINE)
|
||||
if m:
|
||||
|
||||
Reference in New Issue
Block a user