From 8c1e9cbef161f2ff12dadbacf26affd23876fde9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 6 Sep 2020 14:53:18 -0400 Subject: manifest_xml: refactor manifest parsing from client management We conflate the manifest & parsing logic with the management of the repo client checkout in a single class. This makes testing just one part (the manifest parsing) hard as it requires a full checkout too. Start splitting the two apart into separate classes to make it easy to reason about & test. Change-Id: Iaf897c93db9c724baba6044bfe7a589c024523b2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/288682 Reviewed-by: Michael Mortensen Tested-by: Mike Frysinger --- project.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 50bb53c3..29f6b1e8 100644 --- a/project.py +++ b/project.py @@ -510,7 +510,7 @@ class Project(object): with exponential backoff and jitter. old_revision: saved git commit id for open GITC projects. """ - self.manifest = manifest + self.client = self.manifest = manifest self.name = name self.remote = remote self.gitdir = gitdir.replace('\\', '/') @@ -551,7 +551,7 @@ class Project(object): self.linkfiles = [] self.annotations = [] self.config = GitConfig.ForRepository(gitdir=self.gitdir, - defaults=self.manifest.globalConfig) + defaults=self.client.globalConfig) if self.worktree: self.work_git = self._GitGetByExec(self, bare=False, gitdir=gitdir) @@ -1168,7 +1168,7 @@ class Project(object): self._InitHooks() def _CopyAndLinkFiles(self): - if self.manifest.isGitcClient: + if self.client.isGitcClient: return for copyfile in self.copyfiles: copyfile._Copy() -- cgit v1.2.3-54-g00ecf