From 5a41b0be012f65cd03d67042aefbb6ef6796cd38 Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Sun, 2 May 2021 22:55:26 -0700 Subject: [PATCH] superproject: skip updating commit ids if remote's fetchUrl don't match. Tested the code with the following commands. $ ./run_tests -v + Test with local.xml $ repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b master --use-superproject --partial-clone --clone-filter=blob:limit=10M && mkdir -p .repo/local_manifests && (gcertstatus -quiet=true || gcert) && ln -s /google/src/head/depot/google3/wireless/android/build_tools/aosp/manifests/mirror-aosp-master-with-vendor/local.xml .repo/local_manifests/local.xml $ repo_dev sync -c -j8 + Test without local.xml $ repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M --repo-rev=main --use-superproject $ repo_dev sync -c -j8 Bug: [google internal] b/186395810 Change-Id: Id618113a91c12bcb90a30a3c23d3d6842bcb49e1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304942 Reviewed-by: Mike Frysinger Tested-by: Raman Tenneti --- git_superproject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git_superproject.py b/git_superproject.py index 031f45c9..04e2078d 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -262,7 +262,7 @@ class Superproject(object): return None projects_missing_commit_ids = [] - superproject_remote_name = self._manifest.superproject['remote'].name + superproject_fetchUrl = self._manifest.superproject['remote'].fetchUrl for project in projects: path = project.relpath if not path: @@ -274,7 +274,7 @@ class Superproject(object): # superproject's remote. Until superproject, supports multiple remotes, # don't update the commit ids of remotes that don't match superproject's # remote. - if project.remote.name != superproject_remote_name: + if project.remote.fetchUrl != superproject_fetchUrl: continue commit_id = commit_ids.get(path) if commit_id: