734e63aa28f3c1d52d90eba88d9fe8a8a02bf2d6
Two defects found by testing the guard against itself: 1. When invoked through the .git/hooks/pre-commit symlink, deriving the repo root from dirname(BASH_SOURCE)/.. resolved to .git/ instead of the work tree, so the hook scanned nothing and never blocked. Use 'git rev-parse --show-toplevel' instead. 2. The blanket secrets/ rule rejected secrets/.gitkeep. Replaced with an explicit allowlist: .gitkeep, README.md, *.example, *.template. Verified: a staged file containing a Telegram bot token now aborts the commit and leaves HEAD unchanged.
Description
定制不同用途的 Pi Agent
551 KiB
Languages
Python
86.4%
TypeScript
7.8%
Shell
5.8%