@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.
- package/lib/commit.ts +3 -1
- 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
|
-
|
|
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
|
`;
|