From 1ba35f9c99c66523a851dc882e233d63d21fe69b Mon Sep 17 00:00:00 2001 From: glenn schrooyen Date: Mon, 7 Sep 2026 17:27:36 +0200 Subject: [PATCH] PKG-13: one safe.directory flag, not two, and the tighter of the pair Review found `-c safe.directory={where}` and `-c safe.directory=*` set on the same invocation, the specific value redundant once the wildcard is present. Dropped the WILDCARD rather than the specific path, which is the opposite of the suggestion and the tighter end of it: `_git()` always runs `-C where`, so the only repository it ever reads is the one it was pointed at, and naming that one path grants exactly the trust the tool needs. `*` granted trust to every repository on the machine for the lifetime of each subprocess - harmless for read-only `log`/`show` with no tty, as review measured, but broader than the job. Verified after the change: the documented container invocation still runs BOTH halves and reports `no runtime change since the last bump` / `CLEARED for deploy`, so the fix this branch exists for is intact. Suite: 26 files, all pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01BwRLw7eKYj2byVdwB6kbjU --- goodwe_controller/tools/predeploy_check.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/goodwe_controller/tools/predeploy_check.py b/goodwe_controller/tools/predeploy_check.py index a75d5ca..cc718af 100644 --- a/goodwe_controller/tools/predeploy_check.py +++ b/goodwe_controller/tools/predeploy_check.py @@ -118,8 +118,7 @@ def _git(*args, repo=None): """ where = repo or os.path.dirname(ADDON) return subprocess.run( - ["git", "-c", f"safe.directory={where}", "-c", "safe.directory=*", - "-C", where, *args], + ["git", "-c", f"safe.directory={where}", "-C", where, *args], capture_output=True, text=True)