diff options
| author | Mike Frysinger <vapier@google.com> | 2020-09-06 14:53:18 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2020-11-18 19:10:57 +0000 |
| commit | 8c1e9cbef161f2ff12dadbacf26affd23876fde9 (patch) | |
| tree | fcfdc404568a2d8dbc9edd9ec99ecdd758f8c424 /project.py | |
| parent | a488af5ea5c53dd7cf2c90a751e77cc4ba87b7c3 (diff) | |
| download | git-repo-8c1e9cbef161f2ff12dadbacf26affd23876fde9.tar.gz | |
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 <mmortensen@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -510,7 +510,7 @@ class Project(object): | |||
| 510 | with exponential backoff and jitter. | 510 | with exponential backoff and jitter. |
| 511 | old_revision: saved git commit id for open GITC projects. | 511 | old_revision: saved git commit id for open GITC projects. |
| 512 | """ | 512 | """ |
| 513 | self.manifest = manifest | 513 | self.client = self.manifest = manifest |
| 514 | self.name = name | 514 | self.name = name |
| 515 | self.remote = remote | 515 | self.remote = remote |
| 516 | self.gitdir = gitdir.replace('\\', '/') | 516 | self.gitdir = gitdir.replace('\\', '/') |
| @@ -551,7 +551,7 @@ class Project(object): | |||
| 551 | self.linkfiles = [] | 551 | self.linkfiles = [] |
| 552 | self.annotations = [] | 552 | self.annotations = [] |
| 553 | self.config = GitConfig.ForRepository(gitdir=self.gitdir, | 553 | self.config = GitConfig.ForRepository(gitdir=self.gitdir, |
| 554 | defaults=self.manifest.globalConfig) | 554 | defaults=self.client.globalConfig) |
| 555 | 555 | ||
| 556 | if self.worktree: | 556 | if self.worktree: |
| 557 | self.work_git = self._GitGetByExec(self, bare=False, gitdir=gitdir) | 557 | self.work_git = self._GitGetByExec(self, bare=False, gitdir=gitdir) |
| @@ -1168,7 +1168,7 @@ class Project(object): | |||
| 1168 | self._InitHooks() | 1168 | self._InitHooks() |
| 1169 | 1169 | ||
| 1170 | def _CopyAndLinkFiles(self): | 1170 | def _CopyAndLinkFiles(self): |
| 1171 | if self.manifest.isGitcClient: | 1171 | if self.client.isGitcClient: |
| 1172 | return | 1172 | return |
| 1173 | for copyfile in self.copyfiles: | 1173 | for copyfile in self.copyfiles: |
| 1174 | copyfile._Copy() | 1174 | copyfile._Copy() |
