X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-verify-tag.sh;h=726b1e706ba247ee5b17e1312d7195119a690da2;hb=e921fb82cf6fb4a5f138ec9d27bc37c658336a8c;hp=ed4c89396841d8292185b0504ef62ef36007f354;hpb=5a6850e8aae7c6ef4f22e07cb620eb9325543732;p=git.git diff --git a/git-verify-tag.sh b/git-verify-tag.sh index ed4c8939..726b1e70 100755 --- a/git-verify-tag.sh +++ b/git-verify-tag.sh @@ -1,5 +1,13 @@ #!/bin/sh -. git-sh-setup || die "Not a git archive" + +USAGE='' +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." @@ -7,6 +15,9 @@ type="$(git-cat-file -t "$1" 2>/dev/null)" || 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" +