Allow diff and index commands to be interrupted
[git/repo.git] / git-verify-tag.sh
blob726b1e706ba247ee5b17e1312d7195119a690da2
1 #!/bin/sh
3 USAGE='<tag>'
4 SUBDIRECTORY_OK='Yes'
5 . git-sh-setup
7 if [ "$#" != "1" ]
8 then
9 usage
12 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
13 die "$1: no such object."
15 test "$type" = tag ||
16 die "$1: cannot verify a non-tag object of type $type."
18 git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
19 cat "$GIT_DIR/.tmp-vtag" |
20 sed '/-----BEGIN PGP/Q' |
21 gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
22 rm -f "$GIT_DIR/.tmp-vtag"