2005-06-27 02:38:47 +02:00
|
|
|
#!/bin/sh
|
2005-11-28 08:19:58 +01:00
|
|
|
|
2005-12-13 23:30:31 +01:00
|
|
|
USAGE='<tag>'
|
|
|
|
SUBDIRECTORY_OK='Yes'
|
|
|
|
. git-sh-setup
|
2005-06-27 02:38:47 +02:00
|
|
|
|
2006-03-02 01:43:19 +01: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-13 23:30:31 +01:00
|
|
|
if [ "$#" != "1" ]
|
|
|
|
then
|
2006-03-02 01:43:19 +01:00
|
|
|
usage
|
2005-12-13 23:30:31 +01:00
|
|
|
fi
|
2005-11-28 08:33:54 +01:00
|
|
|
|
2005-10-10 01:50:34 +02:00
|
|
|
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
|
|
|
|
die "$1: no such object."
|
2005-06-27 02:38:47 +02:00
|
|
|
|
2005-10-10 01:50:34 +02:00
|
|
|
test "$type" = tag ||
|
|
|
|
die "$1: cannot verify a non-tag object of type $type."
|
|
|
|
|
2006-03-02 01:43:19 +01:00
|
|
|
case "$verbose" in
|
|
|
|
t)
|
|
|
|
git-cat-file -p "$1" |
|
|
|
|
sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-01-03 21:34:20 +01:00
|
|
|
trap 'rm -f "$GIT_DIR/.tmp-vtag"' 0
|
|
|
|
|
2005-11-28 08:19:58 +01:00
|
|
|
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
|
2007-01-03 21:34:20 +01:00
|
|
|
|
2005-11-28 08:19:58 +01:00
|
|
|
cat "$GIT_DIR/.tmp-vtag" |
|
|
|
|
sed '/-----BEGIN PGP/Q' |
|
|
|
|
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
|
|
|
|
rm -f "$GIT_DIR/.tmp-vtag"
|