1#!/bin/sh
23
USAGE='<tag>'
4SUBDIRECTORY_OK='Yes'
5. git-sh-setup
67
verbose=
8while case $# in 0) break;; esac
9do
10case "$1" in
11-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
12verbose=t ;;
13*)
14break ;;
15esac
16shift
17done
1819
if [ "$#" != "1" ]
20then
21usage
22fi
2324
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
25die "$1: no such object."
2627
test "$type" = tag ||
28die "$1: cannot verify a non-tag object of type $type."
2930
case "$verbose" in
31t)
32git-cat-file -p "$1" |
33sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
34;;
35esac
3637
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
38cat "$GIT_DIR/.tmp-vtag" |
39sed '/-----BEGIN PGP/Q' |
40gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
41rm -f "$GIT_DIR/.tmp-vtag"
42