verify-tag: make it operable from a subdirectory.
[alt-git.git] / git-verify-tag.sh
blobd6e0eb87c3df97c978b2de37841fb5fba375a067
1 #!/bin/sh
3 GIT_DIR=`git-rev-parse --git-dir` || exit $?
5 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
6 die "$1: no such object."
8 test "$type" = tag ||
9 die "$1: cannot verify a non-tag object of type $type."
11 git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
12 cat "$GIT_DIR/.tmp-vtag" |
13 sed '/-----BEGIN PGP/Q' |
14 gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
15 rm -f "$GIT_DIR/.tmp-vtag"