diff --git a/git_superproject.py b/git_superproject.py index 8610096..8769355 100644 --- a/git_superproject.py +++ b/git_superproject.py @@ -106,6 +106,11 @@ class Superproject(object): """Returns a dictionary of projects and their commit ids.""" return self._project_commit_ids + @property + def manifest_path(self): + """Returns the manifest path if the path exists or None.""" + return self._manifest_path if os.path.exists(self._manifest_path) else None + def _GetBranch(self): """Returns the branch name for getting the approved manifest.""" p = self._manifest.manifestProject diff --git a/subcmds/sync.py b/subcmds/sync.py index a770c25..7461754 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -301,6 +301,12 @@ later is required to fix a server side protocol bug. self.repodir, self.git_event_log, quiet=opt.quiet) + if opt.local_only: + manifest_path = superproject.manifest_path + if manifest_path: + self._ReloadManifest(manifest_path, load_local_manifests) + return manifest_path + all_projects = self.GetProjects(args, missing_ok=True, submodules_ok=opt.fetch_submodules)