From 21b6e05df27d9ff9c29c81d576f5d1aef3ff6b06 Mon Sep 17 00:00:00 2001 From: Jin Xiao Date: Sun, 4 Oct 2026 20:38:44 +0800 Subject: [PATCH] fix(release): disable detached maintenance in Git test fixtures --- tools/test_release_automation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/test_release_automation.py b/tools/test_release_automation.py index d28078a..3751507 100644 --- a/tools/test_release_automation.py +++ b/tools/test_release_automation.py @@ -111,7 +111,10 @@ def fixture(): shutil.copyfile(ROOT / "tools/modules.py", root / "tools/modules.py") (root / "go.work").write_text("go 1.26\n\nuse (\n" + "\n".join("\t" + ("." if module["directory"] == "." else "./" + module["directory"]) for module in modules) + "\n)\n", encoding="utf-8") (root / ".gitignore").write_text("dist/\n__pycache__/\n", encoding="utf-8") - for args in (("init",), ("config", "user.name", "Fixture"), ("config", "user.email", "fixture@example.com"), ("add", "."), ("commit", "-m", "Import modules")): + # Detached Git maintenance must not outlive a disposable fixture. + for args in (("init",), ("config", "maintenance.auto", "false"), ("config", "gc.auto", "0"), + ("config", "user.name", "Fixture"), ("config", "user.email", "fixture@example.com"), + ("add", "."), ("commit", "-m", "Import modules")): command(root, "git", *args) source = command(root, "git", "rev-parse", "HEAD") command(root, "git", "update-ref", "refs/remotes/origin/main", source)