Browse Source

Don't clear directory for new/removed entries

This was from back when we were clearing the whole directory instead
of just the extracted contents

Bug: b/324418194
Change-Id: I496b0faed2023a8fa3b4ea772a7744f2acc9be6a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5459298
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Stephanie Kim 1 year ago
parent
commit
336643a14b
1 changed files with 2 additions and 10 deletions
  1. 2 10
      gclient_scm.py

+ 2 - 10
gclient_scm.py

@@ -1987,17 +1987,9 @@ class GcsRoot(object):
 
             # If any GCS deps are added or removed entirely, clobber that path
             intersected_paths = parsed_paths.intersection(resolved_paths)
-            # Added paths
-            for path in parsed_paths - intersected_paths:
-                full_path = os.path.join(self.root_dir, path)
-                gclient_utils.rmtree(full_path)
-            # Removed paths
-            for path in resolved_paths - intersected_paths:
-                full_path = os.path.join(self.root_dir, path)
-                gclient_utils.rmtree(full_path)
 
-            # If any objects within a GCS dep are added/removed, clobber that
-            # entire path
+            # If any objects within a GCS dep are added/removed, clobber its
+            # extracted contents and relevant gcs dotfiles
             for path in intersected_paths:
                 resolved_objects = resolved_object_dict[path]
                 parsed_objects = parsed_object_dict[path]