aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2022-10-06 07:07:56 +0800
committerJesús <heckyel@hyperbola.info>2022-10-06 07:07:56 +0800
commit2d318ab96316d7f91b151de7d495d8bc6be2f683 (patch)
treec0f3f4b1e8678c65978d7348254e96c40c71df71
parent76f2ed5254ada5d520d27364c621769e7109f186 (diff)
downloadgit-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.tar.lz
git-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.tar.xz
git-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.zip
Add check_notes, prevent invalid signature
-rwxr-xr-xgit-snapsign10
1 files changed, 10 insertions, 0 deletions
diff --git a/git-snapsign b/git-snapsign
index c1dce21..2643167 100755
--- a/git-snapsign
+++ b/git-snapsign
@@ -90,6 +90,15 @@ check_format() {
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
#---------
@@ -135,6 +144,7 @@ while getopts ":dfPhvF:s:p:t:" opt; do
keyid="$OPTARG"
;;
t)
+ check_notes "$@"
if ! git rev-parse --verify "${OPTARG}" >/dev/null 2>&1; then
echo -e "fatal: failed to verify tag: ${OPTARG}"
exit 1