From 5fa912b0d148cf92f72640ac7dcff98c5db11853 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 14 Apr 2022 14:41:13 +0000 Subject: Stop passing optparse.Values to git_superproject Make git_superproject independent of the command line by passing the specific value instead of requiring the caller to have an optparse.Values object to pass in. Flag --use-superproject and --archive as incompatible in subcmds/init.py Change-Id: Ied7c874b312e151038df903c8af4328f070f387c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/335135 Tested-by: LaMont Jones Reviewed-by: Raman Tenneti Reviewed-by: Mike Frysinger --- subcmds/sync.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'subcmds/sync.py') diff --git a/subcmds/sync.py b/subcmds/sync.py index 4d0a5ec6..3451ab6b 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -286,7 +286,7 @@ later is required to fix a server side protocol bug. True if a superproject is requested, otherwise the value of the current_branch option (True, False or None). """ - return git_superproject.UseSuperproject(opt, self.manifest) or opt.current_branch_only + return git_superproject.UseSuperproject(opt.use_superproject, self.manifest) or opt.current_branch_only def _UpdateProjectsRevisionId(self, opt, args, load_local_manifests, superproject_logging_data): """Update revisionId of every project with the SHA from superproject. @@ -306,7 +306,8 @@ later is required to fix a server side protocol bug. """ superproject = self.manifest.superproject superproject.SetQuiet(opt.quiet) - print_messages = git_superproject.PrintMessages(opt, self.manifest) + print_messages = git_superproject.PrintMessages(opt.use_superproject, + self.manifest) superproject.SetPrintMessages(print_messages) if opt.local_only: manifest_path = superproject.manifest_path @@ -993,7 +994,8 @@ later is required to fix a server side protocol bug. self._UpdateManifestProject(opt, mp, manifest_name) load_local_manifests = not self.manifest.HasLocalManifests - use_superproject = git_superproject.UseSuperproject(opt, self.manifest) + use_superproject = git_superproject.UseSuperproject(opt.use_superproject, + self.manifest) if use_superproject and (self.manifest.IsMirror or self.manifest.IsArchive): # Don't use superproject, because we have no working tree. use_superproject = False -- cgit v1.2.3-54-g00ecf