fix(hook): 支持 --cached/--staged 参数并优化 pre-commit 脚本

This commit is contained in:
unclesam committed 2026-08-18 11:21:22 +08:00
1 parent 0b4d02d232
commit 1493b0a392
3 files changed
+14 -8

No files matched your search

+1 -2
View File
@@ -12,8 +12,7 @@ import (
const preCommitScript = `#!/bin/sh
# git-air pre-commit hook
echo "[git-air] 正在执行 Commit 前代码自动化评审..."
git-air --cached
# 如果评审发现阻断性问题,可通过退出码阻断 commit
git-air
`
var hookCmd = &cobra.Command{