]> git.ipfire.org Git - thirdparty/git.git/blob - git-verify-tag.sh
Merge branch 'jc/subdir'
[thirdparty/git.git] / git-verify-tag.sh
1 #!/bin/sh
2
3 GIT_DIR=`git-rev-parse --git-dir` || exit $?
4
5 die () {
6 echo >&2 "$*"
7 exit 1
8 }
9
10 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
11 die "$1: no such object."
12
13 test "$type" = tag ||
14 die "$1: cannot verify a non-tag object of type $type."
15
16 git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
17 cat "$GIT_DIR/.tmp-vtag" |
18 sed '/-----BEGIN PGP/Q' |
19 gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
20 rm -f "$GIT_DIR/.tmp-vtag"
21