Prevent sync from deleting existing non-git-sources when in cog.

Bug:b/353461856
Change-Id: I08e6a27fdbcc445629898422ee04449376911a0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5713190
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Stephanie Kim <kimstephanie@google.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
changes/90/5713190/2
Joanna Wang 10 months ago committed by LUCI CQ
parent 9b51399218
commit a4a850aa7b

@ -840,7 +840,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# Check if at least one object needs to be downloaded.
needs_download = any(gcs.IsDownloadNeeded() for gcs in gcs_deps)
if needs_download and os.path.exists(gcs_deps[0].output_dir):
# When IsEnvCog(), gcs sources are already present and are not managed by gclient.
if not gclient_utils.IsEnvCog(
) and needs_download and os.path.exists(gcs_deps[0].output_dir):
# Since we don't know what old content to remove, we remove
# the entire output_dir. All gcs_deps are expected to have
# the same output_dir, so we get the first one, which must

Loading…
Cancel
Save