@shelken/pi-co-authored-by 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/commit.ts +3 -1
  2. package/package.json +1 -1
package/lib/commit.ts CHANGED
@@ -180,7 +180,9 @@ fi
180
180
 
181
181
  hooks_dir="$(dirname "$0")"
182
182
  user_hook="$hooks_dir/prepare-commit-msg.pi-user"
183
- if [ -x "$user_hook" ]; then
183
+ # 跳过会注入 Co-Authored-By 的既有 hook(如 dsh 等其它注入器的残留 hook),
184
+ # 避免同一提交被多个注入器写入重复 trailer
185
+ if [ -x "$user_hook" ] && ! grep -q 'Co-Authored-By' "$user_hook" 2>/dev/null; then
184
186
  "$user_hook" "$@"
185
187
  fi
186
188
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelken/pi-co-authored-by",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "agent 执行 git commit 时自动追加 Co-Authored-By / Generated-By trailer",
5
5
  "type": "module",
6
6
  "license": "MIT",