Add check_notes, prevent invalid signature
This commit is contained in:
parent
76f2ed5254
commit
2d318ab963
10
git-snapsign
10
git-snapsign
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user