[core] Stop parent git repos from breaking ESP-IDF/PlatformIO builds (#16994)

This commit is contained in:
Jesse Hills
2026-06-16 20:24:26 +12:00
committed by GitHub
parent b09a5f9e43
commit d8fa0e4140
6 changed files with 78 additions and 0 deletions
+27
View File
@@ -196,6 +196,33 @@ def test_is_ha_addon(monkeypatch, value, expected):
assert actual == expected
def test_add_git_ceiling_directory_sets_when_unset():
"""An empty env gets GIT_CEILING_DIRECTORIES set to the directory."""
env: dict[str, str] = {}
directory = Path("/home/user/config")
helpers.add_git_ceiling_directory(env, directory)
assert env["GIT_CEILING_DIRECTORIES"] == str(directory)
def test_add_git_ceiling_directory_appends_to_existing():
"""An existing value is preserved and the new directory is appended."""
env = {"GIT_CEILING_DIRECTORIES": str(Path("/some/ceiling"))}
directory = Path("/home/user/config")
helpers.add_git_ceiling_directory(env, directory)
assert env["GIT_CEILING_DIRECTORIES"].split(os.pathsep) == [
str(Path("/some/ceiling")),
str(directory),
]
def test_add_git_ceiling_directory_skips_duplicate():
"""A directory already in the list is not appended again."""
directory = Path("/home/user/config")
env = {"GIT_CEILING_DIRECTORIES": str(directory)}
helpers.add_git_ceiling_directory(env, directory)
assert env["GIT_CEILING_DIRECTORIES"] == str(directory)
def test_walk_files(fixture_path):
path = fixture_path / "helpers"