From a84f43a0065e7af2a30fd6b99bf3f13efcc7961c Mon Sep 17 00:00:00 2001 From: Jack Neus Date: Tue, 21 Sep 2021 22:23:55 +0000 Subject: 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 Tested-by: Jack Neus --- tests/test_manifest_xml.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/test_manifest_xml.py') 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 @@ -261,6 +261,19 @@ class XmlManifestTests(ManifestParseTestCase): +""") + self.assertEqual(manifest.repo_hooks_project.name, 'repohooks') + self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b']) + + def test_repo_hooks_unordered(self): + """Check repo-hooks settings work even if the project def comes second.""" + manifest = self.getXmlManifest(""" + + + + + + """) self.assertEqual(manifest.repo_hooks_project.name, 'repohooks') self.assertEqual(manifest.repo_hooks_project.enabled_repo_hooks, ['a', 'b']) -- cgit v1.2.3-54-g00ecf