2005-06-27 04:38:47 +04:00
|
|
|
#!/bin/sh
|
2005-11-28 10:19:58 +03:00
|
|
|
|
2005-12-14 01:30:31 +03:00
|
|
|
USAGE='<tag>'
|
|
|
|
SUBDIRECTORY_OK='Yes'
|
|
|
|
. git-sh-setup
|
2005-06-27 04:38:47 +04:00
|
|
|
|
2006-03-02 03:43:19 +03:00
|
|
|
verbose=
|
|
|
|
while case $# in 0) break;; esac
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
|
|
|
|
verbose=t ;;
|
|
|
|
*)
|
|
|
|
break ;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
2005-12-14 01:30:31 +03:00
|
|
|
if [ "$#" != "1" ]
|
|
|
|
then
|
2006-03-02 03:43:19 +03:00
|
|
|
usage
|
2005-12-14 01:30:31 +03:00
|
|
|
fi
|
2005-11-28 10:33:54 +03:00
|
|
|
|
2005-10-10 03:50:34 +04:00
|
|
|
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
|
|
|
|
die "$1: no such object."
|
2005-06-27 04:38:47 +04:00
|
|
|
|
2005-10-10 03:50:34 +04:00
|
|
|
test "$type" = tag ||
|
|
|
|
die "$1: cannot verify a non-tag object of type $type."
|
|
|
|
|
2006-03-02 03:43:19 +03:00
|
|
|
case "$verbose" in
|
|
|
|
t)
|
|
|
|
git-cat-file -p "$1" |
|
|
|
|
sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2005-11-28 10:19:58 +03:00
|
|
|
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
|
|
|
|
cat "$GIT_DIR/.tmp-vtag" |
|
|
|
|
sed '/-----BEGIN PGP/Q' |
|
|
|
|
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
|
|
|
|
rm -f "$GIT_DIR/.tmp-vtag"
|
|
|
|
|