fix: ignore global git config in sitemap lastmod test commits

The sitemap lastmod test failed wherever the global git config enabled commit signing with an unreachable key, because the test strips every GIT_* variable and so dropped any override that disabled signing.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-10-31 22:28:17 +08:00
co-authored by Claude
parent 038f184473
commit 4d9814a625
+1 -1
View File
@@ -250,7 +250,7 @@ class TestBuild:
self._make_repo(tmp_path, readme)
def commit(day, message):
env = {**os.environ, "GIT_AUTHOR_DATE": f"{day}T12:00:00Z", "GIT_COMMITTER_DATE": f"{day}T12:00:00Z"}
env = {**os.environ, "GIT_CONFIG_GLOBAL": "/dev/null", "GIT_AUTHOR_DATE": f"{day}T12:00:00Z", "GIT_COMMITTER_DATE": f"{day}T12:00:00Z"}
subprocess.run(["git", "add", "-A"], cwd=tmp_path, check=True)
subprocess.run(["git", "-c", "user.name=t", "-c", "user.email=t@t", "commit", "-qm", message], cwd=tmp_path, env=env, check=True)