Add check_notes, prevent invalid signature

This commit is contained in:
Jesús 2022-10-06 07:07:56 +08:00
parent 76f2ed5254
commit 2d318ab963
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -90,6 +90,15 @@ check_format() {
fi fi
} }
check_notes() {
if ! git show-ref --quiet --verify -- "refs/notes" >/dev/null 2>&1; then
git config --add remote.origin.fetch "+refs/notes/*:refs/notes/*" >/dev/null 2>&1
git fetch >/dev/null 2>&1
else
git fetch >/dev/null 2>&1
fi
}
#--------- #---------
# core # core
#--------- #---------
@ -135,6 +144,7 @@ while getopts ":dfPhvF:s:p:t:" opt; do
keyid="$OPTARG" keyid="$OPTARG"
;; ;;
t) t)
check_notes "$@"
if ! git rev-parse --verify "${OPTARG}" >/dev/null 2>&1; then if ! git rev-parse --verify "${OPTARG}" >/dev/null 2>&1; then
echo -e "fatal: failed to verify tag: ${OPTARG}" echo -e "fatal: failed to verify tag: ${OPTARG}"
exit 1 exit 1