summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-05-02 22:55:26 -0700
committerRaman Tenneti <rtenneti@google.com>2021-05-04 15:32:23 +0000
commit5a41b0be012f65cd03d67042aefbb6ef6796cd38 (patch)
tree5fc3b1efa10e7f6f8ea36b2f1c163467d35148df
parentd68ed63328fedaf227e61390267d06637edbafae (diff)
downloadgit-repo-5a41b0be012f65cd03d67042aefbb6ef6796cd38.tar.gz
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 <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
-rw-r--r--git_superproject.py4
1 files 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):
262 return None 262 return None
263 263
264 projects_missing_commit_ids = [] 264 projects_missing_commit_ids = []
265 superproject_remote_name = self._manifest.superproject['remote'].name 265 superproject_fetchUrl = self._manifest.superproject['remote'].fetchUrl
266 for project in projects: 266 for project in projects:
267 path = project.relpath 267 path = project.relpath
268 if not path: 268 if not path:
@@ -274,7 +274,7 @@ class Superproject(object):
274 # superproject's remote. Until superproject, supports multiple remotes, 274 # superproject's remote. Until superproject, supports multiple remotes,
275 # don't update the commit ids of remotes that don't match superproject's 275 # don't update the commit ids of remotes that don't match superproject's
276 # remote. 276 # remote.
277 if project.remote.name != superproject_remote_name: 277 if project.remote.fetchUrl != superproject_fetchUrl:
278 continue 278 continue
279 commit_id = commit_ids.get(path) 279 commit_id = commit_ids.get(path)
280 if commit_id: 280 if commit_id: