From 5175d18f8ab272e14aa3ac2e45c509f9ae162109 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Wed, 7 Dec 2022 17:27:57 +0000 Subject: [PATCH] Remove branch option from git cache update-bootstrap. in update_bootstrap, it's only used for `git number`. without it git number defaults to `HEAD` and nothing seems to actually set the `branch` option https://source.chromium.org/search?q=%22update-bootstrap%22 Should fix the following failure: http://shortn/_nLLz2nJAGS Change-Id: I5f3eb8497133c1e5d2f964af969ca61ab6256330 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4080542 Reviewed-by: Josip Sokcevic Commit-Queue: Joanna Wang --- git_cache.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/git_cache.py b/git_cache.py index 1c5a1fe38..a402fc278 100755 --- a/git_cache.py +++ b/git_cache.py @@ -509,7 +509,7 @@ class Mirror(object): self._fetch(self.mirror_path, verbose, depth, no_fetch_tags, reset_fetch_config) - def update_bootstrap(self, prune=False, gc_aggressive=False, branch='main'): + def update_bootstrap(self, prune=False, gc_aggressive=False): # NOTE: There have been cases where repos were being recursively uploaded # to google storage. # E.g. `-//-/` in GS and @@ -524,9 +524,9 @@ class Mirror(object): gclient_utils.rmtree(recursed_dir) # The folder is - gen_number = subprocess.check_output( - [self.git_exe, 'number', branch], - cwd=self.mirror_path).decode('utf-8', 'ignore').strip() + gen_number = subprocess.check_output([self.git_exe, 'number'], + cwd=self.mirror_path).decode( + 'utf-8', 'ignore').strip() gsutil = Gsutil(path=self.gsutil_exe, boto_path=None) dest_prefix = '%s/%s' % (self._gs_path, gen_number) @@ -655,8 +655,6 @@ def CMDupdate_bootstrap(parser, args): help='Run aggressive repacking of the repo.') parser.add_option('--prune', action='store_true', help='Prune all other cached bundles of the same repo.') - parser.add_option('--branch', default='main', - help='Branch to use for bootstrap. (Default \'main\')') populate_args = args[:] options, args = parser.parse_args(args) @@ -671,7 +669,7 @@ def CMDupdate_bootstrap(parser, args): _, args2 = parser.parse_args(args) url = args2[0] mirror = Mirror(url) - mirror.update_bootstrap(options.prune, options.gc_aggressive, options.branch) + mirror.update_bootstrap(options.prune, options.gc_aggressive) return 0