fix(layout): handle submodule sections whose name differs from path
ci/woodpecker/push/eco Pipeline was successful
ci/woodpecker/push/eco Pipeline was successful
The duplicate-settings guard compared the section field dict with a set and could raise TypeError instead of reporting the real configuration error. Compare sets and add a fixture accepting a section name that differs from its path.
This commit is contained in:
1 parent
f08ec00dec
commit
7aac052149
2 files changed
+10
-1
No files matched your search
@@ -658,6 +658,15 @@ release = "optional"
|
||||
with self.assertRaisesRegex(ValueError, "invalid submodule URL: cli"):
|
||||
layout.validate("HEAD", False)
|
||||
|
||||
def test_accepts_a_submodule_section_name_that_differs_from_its_path(self):
|
||||
self.root_repo(CLI, {"cli": "a" * 40}, {"cli": CORE_URL})
|
||||
self.write(self.root, ".gitmodules",
|
||||
f'[submodule "core-runtime"]\n\tpath = cli\n\turl = {CORE_URL}\n')
|
||||
self.stage(self.root)
|
||||
self.gitlink(self.root, "cli", "a" * 40)
|
||||
self.git("commit", "-qm", "named section")
|
||||
layout.validate("HEAD", False)
|
||||
|
||||
def test_rejects_a_wrong_domain_root_url(self):
|
||||
self.root_repo(CLI + WEB_DOMAIN,
|
||||
{"cli": "a" * 40, "extensions/web": "b" * 40},
|
||||
|
||||
Reference in new issue
Block a user