summaryrefslogtreecommitdiffstats
path: root/tests/test_manifest_xml.py
diff options
context:
space:
mode:
authorJack Neus <jackneus@google.com>2021-09-21 22:23:55 +0000
committerJack Neus <jackneus@google.com>2021-09-23 21:17:38 +0000
commita84f43a0065e7af2a30fd6b99bf3f13efcc7961c (patch)
tree65f6fd8a7acbb216cf7032086072ac9d7947a176 /tests/test_manifest_xml.py
parent0468feac395f6b1fc310387db606cf6b6ed53f33 (diff)
downloadgit-repo-a84f43a0065e7af2a30fd6b99bf3f13efcc7961c.tar.gz
manifest: make repo-hooks more robust wrt element ordering
Currently, repo will fail to sync to a manifest if the definition of the repo-hooks project comes after the repo-hooks element. BUG=none TEST=new test, run_tests Change-Id: I0bf85625173492af6c6404d4b67543e96e670562 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318520 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jack Neus <jackneus@google.com>
Diffstat (limited to 'tests/test_manifest_xml.py')
-rw-r--r--tests/test_manifest_xml.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py
index 59f2a779..20459d1d 100644
--- a/tests/test_manifest_xml.py
+++ b/tests/test_manifest_xml.py
@@ -265,6 +265,19 @@ class XmlManifestTests(ManifestParseTestCase):
265 self.assertEqual(manifest.repo_hooks_project.name, 'repohooks') 265 self.assertEqual(manifest.repo_hooks_project.name, 'repohooks')
266 self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b']) 266 self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b'])
267 267
268 def test_repo_hooks_unordered(self):
269 """Check repo-hooks settings work even if the project def comes second."""
270 manifest = self.getXmlManifest("""
271<manifest>
272 <remote name="test-remote" fetch="http://localhost" />
273 <default remote="test-remote" revision="refs/heads/main" />
274 <repo-hooks in-project="repohooks" enabled-list="a, b"/>
275 <project name="repohooks" path="src/repohooks"/>
276</manifest>
277""")
278 self.assertEqual(manifest.repo_hooks_project.name, 'repohooks')
279 self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b'])
280
268 def test_unknown_tags(self): 281 def test_unknown_tags(self):
269 """Check superproject settings.""" 282 """Check superproject settings."""
270 manifest = self.getXmlManifest(""" 283 manifest = self.getXmlManifest("""