]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-verify-tag.sh
Use symbolic name SHORT_NAME_AMBIGUOUS as error return value
[thirdparty/git.git] / git-verify-tag.sh
index 3c65f4a6b51707601bc8f66657e6e79cc33094fd..726b1e706ba247ee5b17e1312d7195119a690da2 100755 (executable)
@@ -1,12 +1,23 @@
 #!/bin/sh
+
+USAGE='<tag>'
+SUBDIRECTORY_OK='Yes'
 . git-sh-setup
 
+if [ "$#" != "1" ]
+then
+  usage
+fi
+
 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
        die "$1: no such object."
 
 test "$type" = tag ||
        die "$1: cannot verify a non-tag object of type $type."
 
-git-cat-file tag "$1" > .tmp-vtag || exit 1
-cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag - || exit 1
-rm -f .tmp-vtag
+git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
+cat "$GIT_DIR/.tmp-vtag" |
+sed '/-----BEGIN PGP/Q' |
+gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
+rm -f "$GIT_DIR/.tmp-vtag"
+