From cf0ba48649bab9fc6c88dcf15c1ae66d3717693d Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Mon, 6 Dec 2021 18:12:59 -0800 Subject: [PATCH] sync: With --mirror option, don't display no-use-superproject... message. + Display 'Defaulting to no-use-superproject because there is no working tree.' message if --use-superproject option is used and we are not using superproject because manifest is either a mirror or is an archive. Tested the code with the following commands. $ ./run_tests -v Tested the sync code by using repo_dev alias and pointing to this CL. $ repo init -u https://android.googlesource.com/mirror/manifest --mirror $ repo_dev sync Receiving objects: 100% (3/3), done.eiving objects: 33% (1/3) $ repo_dev sync --use-superproject Defaulting to no-use-superproject because there is no working tree. Fetching: 0% (0/2158) warming up Bug: https://crbug.com/gerrit/15368 Change-Id: I16b87ee9623315dbc3100b612b1decdaab7ac1dc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/325797 Reviewed-by: Mike Frysinger Tested-by: Raman Tenneti --- subcmds/sync.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index 4898430b..707c5bbd 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -986,10 +986,11 @@ later is required to fix a server side protocol bug. load_local_manifests = not self.manifest.HasLocalManifests use_superproject = git_superproject.UseSuperproject(opt, self.manifest) - if self.manifest.IsMirror or self.manifest.IsArchive: + if use_superproject and (self.manifest.IsMirror or self.manifest.IsArchive): # Don't use superproject, because we have no working tree. use_superproject = False - print('Defaulting to no-use-superproject because there is no working tree.') + if opt.use_superproject is not None: + print('Defaulting to no-use-superproject because there is no working tree.') superproject_logging_data = { 'superproject': use_superproject, 'haslocalmanifests': bool(self.manifest.HasLocalManifests),