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 []