From 2d8b4bb8da8a82783ddc58eb42073b382d98363a Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 13 Nov 2026 01:02:45 +0100 Subject: [PATCH] =?UTF-8?q?Answer=20security=20round=201:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=200=20=F0=9F=9F=A1=20(0=20misread);=20run=20rule-?= =?UTF-8?q?hook's=20config=20lookup=20through=20guarded=20git?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/rule_hook/todo_check.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/rule_hook/todo_check.py b/bin/rule_hook/todo_check.py index 9fbb9587..80582ab2 100644 --- a/bin/rule_hook/todo_check.py +++ b/bin/rule_hook/todo_check.py @@ -1,3 +1,4 @@ +import functools import hashlib import pathlib import subprocess @@ -5,6 +6,7 @@ import sys from rule_hook.rules import Breach from failure import Failure +from git_cli.git_repo import git from rule_hook.git import guarded_git from project_config.main import located from release_plan import plan_file @@ -22,7 +24,7 @@ def todo_breaches(directory: str, own: pathlib.Path = OWN) -> list[Breach]: top = guarded_git(directory, "rev-parse", "--show-toplevel") if isinstance(top, Failure): return [] - config = located(top, pathlib.Path.home()) + config = located(top, pathlib.Path.home(), functools.partial(git, guarded=True)) if isinstance(config, Failure): # A checkout with a todo.md and no config is one whose config is still to write. return [Breach("todo-rank-check", config.reason, top)] if (pathlib.Path(top) / "todo.md").is_file() else []