From 0ddb6776110aaefee3f93cc171d11dcdc12d082b Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Fri, 20 May 2022 09:11:54 +0000 Subject: project: fix --use-superproject logic for init. If init was run with --use-superproject, init failed. If init was run without --{no,}use-superproject option then manifests with elements were mishandled. Bug: b/233226285 Test: manual Change-Id: I737e71c89d2d7c324114f58bf2dc82b40e5beba7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/337534 Reviewed-by: Mike Frysinger Tested-by: LaMont Jones --- project.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 2641c445..9f790308 100644 --- a/project.py +++ b/project.py @@ -3790,10 +3790,10 @@ class ManifestProject(MetaProject): outer_manifest=False, ) - # Lastly, clone the superproject(s). - if self.manifest.manifestProject.use_superproject: - sync_result = Superproject( - self.manifest, self.manifest.repodir, git_event_log, quiet=not verbose).Sync() + # Lastly, if the manifest has a then have the superproject + # sync it if it will be used. + if self.manifest.superproject: + sync_result = self.manifest.superproject.Sync(git_event_log) if not sync_result.success: print('warning: git update of superproject for ' f'{self.manifest.path_prefix} failed, repo sync will not use ' -- cgit v1.2.3-54-g00ecf