]> git.ipfire.org Git - thirdparty/git.git/blame - git-verify-tag.sh
Use symbolic name SHORT_NAME_AMBIGUOUS as error return value
[thirdparty/git.git] / git-verify-tag.sh
CommitLineData
f336e71f 1#!/bin/sh
d6ea70af 2
34970121
FK
3USAGE='<tag>'
4SUBDIRECTORY_OK='Yes'
5. git-sh-setup
f336e71f 6
34970121
FK
7if [ "$#" != "1" ]
8then
9 usage
10fi
d165fa14 11
5a6850e8
PBG
12type="$(git-cat-file -t "$1" 2>/dev/null)" ||
13 die "$1: no such object."
f336e71f 14
5a6850e8
PBG
15test "$type" = tag ||
16 die "$1: cannot verify a non-tag object of type $type."
17
d6ea70af
JH
18git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
19cat "$GIT_DIR/.tmp-vtag" |
20sed '/-----BEGIN PGP/Q' |
21gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
22rm -f "$GIT_DIR/.tmp-vtag"
23