#!/bin/sh
# commit-msg 钩子：提交信息编码校验（非法 UTF-8 / GBK 乱码 → 拒绝提交）
# 校验逻辑见同目录 commit_msg_check.py
hook_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
if ! python "$hook_dir/commit_msg_check.py" "$1"; then
    echo "commit-msg 校验未通过，提交已中止。请修正提交信息后重试。" >&2
    exit 1
fi
exit 0
