Selaa lähdekoodia

[git_cache] Fix shadowing for `bootstrap`

The `bootstrap` function within `populate` is shadowing the `bootstrap`
argument. This causes the `_ensure_bootsrapped` function to receive a
function pointer rather than passing along the boolean value.

Bug: 326116358
Change-Id: I6c03eb8bfbbc3385e1e9e653e43fdf9416cd244f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5310976
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Kyle Farnung <kfarnung@microsoft.com>
Kyle Farnung 1 vuosi sitten
vanhempi
commit
b26059ac45
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      git_cache.py

+ 3 - 3
git_cache.py

@@ -555,7 +555,7 @@ class Mirror(object):
             depth = 10000
             depth = 10000
         gclient_utils.safe_makedirs(self.GetCachePath())
         gclient_utils.safe_makedirs(self.GetCachePath())
 
 
-        def bootstrap(force=False):
+        def bootstrap_cache(force=False):
             self._ensure_bootstrapped(depth,
             self._ensure_bootstrapped(depth,
                                       bootstrap,
                                       bootstrap,
                                       reset_fetch_config,
                                       reset_fetch_config,
@@ -572,12 +572,12 @@ class Mirror(object):
                 wipe_cache()
                 wipe_cache()
 
 
             try:
             try:
-                bootstrap()
+                bootstrap_cache()
             except ClobberNeeded:
             except ClobberNeeded:
                 # This is a major failure, we need to clean and force a
                 # This is a major failure, we need to clean and force a
                 # bootstrap.
                 # bootstrap.
                 wipe_cache()
                 wipe_cache()
-                bootstrap(force=True)
+                bootstrap_cache(force=True)
 
 
     def update_bootstrap(self, prune=False, gc_aggressive=False):
     def update_bootstrap(self, prune=False, gc_aggressive=False):
         # NOTE: There have been cases where repos were being recursively
         # NOTE: There have been cases where repos were being recursively