agents: scope git hygiene hook to git add commands

The `PreToolUse:Bash` hook invoked `enforce-git-hygiene.sh` on every Bash tool call, even though the script only blocks `git add . / -A / --all`. Add `"if": "Bash(git add *)"` so the script only runs when the command actually contains `git add`.
This commit is contained in:
Stefano Baghino
2026-05-21 10:29:54 +02:00
parent 7287aa0d5c
commit b162a7a83a
+1
View File
@@ -16,6 +16,7 @@
"hooks": [
{
"type": "command",
"if": "Bash(git add *)",
"command": "bash .agents/hooks/enforce-git-hygiene.sh"
}
],