diff --git a/subcmds/init.py b/subcmds/init.py index a3f3241..1fbe465 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -478,8 +478,13 @@ to update the working directory files. # Check this here, else manifest will be tagged "not new" and init won't be # possible anymore without removing the .repo/manifests directory. - if opt.archive and opt.mirror: - self.OptionParser.error('--mirror and --archive cannot be used together.') + if opt.mirror: + if opt.archive: + self.OptionParser.error('--mirror and --archive cannot be used ' + 'together.') + if opt.use_superproject is not None: + self.OptionParser.error('--mirror and --use-superproject cannot be ' + 'used together.') if opt.standalone_manifest and ( opt.manifest_branch or opt.manifest_name != 'default.xml'): diff --git a/subcmds/sync.py b/subcmds/sync.py index 1d778e1..ee7e4a8 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -986,6 +986,10 @@ 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: + # 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.') superproject_logging_data = { 'superproject': use_superproject, 'haslocalmanifests': bool(self.manifest.HasLocalManifests),