You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
763 B
46 lines
763 B
20 years ago
|
#!/bin/sh
|
||
19 years ago
|
|
||
19 years ago
|
USAGE='<tag>'
|
||
|
SUBDIRECTORY_OK='Yes'
|
||
|
. git-sh-setup
|
||
20 years ago
|
|
||
19 years ago
|
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
|
||
|
|
||
19 years ago
|
if [ "$#" != "1" ]
|
||
|
then
|
||
19 years ago
|
usage
|
||
19 years ago
|
fi
|
||
19 years ago
|
|
||
18 years ago
|
type="$(git cat-file -t "$1" 2>/dev/null)" ||
|
||
19 years ago
|
die "$1: no such object."
|
||
20 years ago
|
|
||
19 years ago
|
test "$type" = tag ||
|
||
|
die "$1: cannot verify a non-tag object of type $type."
|
||
|
|
||
19 years ago
|
case "$verbose" in
|
||
|
t)
|
||
18 years ago
|
git cat-file -p "$1" |
|
||
19 years ago
|
sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
|
||
|
;;
|
||
|
esac
|
||
|
|
||
18 years ago
|
trap 'rm -f "$GIT_DIR/.tmp-vtag"' 0
|
||
|
|
||
18 years ago
|
git cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
|
||
18 years ago
|
sed -n -e '
|
||
|
/^-----BEGIN PGP SIGNATURE-----$/q
|
||
|
p
|
||
|
' <"$GIT_DIR/.tmp-vtag" |
|
||
19 years ago
|
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
|
||
|
rm -f "$GIT_DIR/.tmp-vtag"
|