diff options
author | Jesús <heckyel@hyperbola.info> | 2022-10-06 07:07:56 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-10-06 07:07:56 +0800 |
commit | 2d318ab96316d7f91b151de7d495d8bc6be2f683 (patch) | |
tree | c0f3f4b1e8678c65978d7348254e96c40c71df71 | |
parent | 76f2ed5254ada5d520d27364c621769e7109f186 (diff) | |
download | git-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.tar.lz git-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.tar.xz git-snapsign-2d318ab96316d7f91b151de7d495d8bc6be2f683.zip |
Add check_notes, prevent invalid signature
-rwxr-xr-x | git-snapsign | 10 |
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 |