@matheusbsbs / matheus-bagliano / commits / d6ea70af77
Fork 0

verify-tag: make it operable from a subdirectory.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 27, 2005 at 23:19 UTC d6ea70af7708af5f29db09b2d782ab3b9ce50f79
1 file changed +8 -4
git-verify-tag.sh
+8 -4
@@ -1,5 +1,6 @@
1 #!/bin/sh
2 -. git-sh-setup
2 +
3 +GIT_DIR=`git-rev-parse --git-dir` || exit $?
4
5 type="$(git-cat-file -t "$1" 2>/dev/null)" ||
6 die "$1: no such object."
@@ -7,6 +8,9 @@ type="$(git-cat-file -t "$1" 2>/dev/null)" ||
8 test "$type" = tag ||
9 die "$1: cannot verify a non-tag object of type $type."
10
10 -git-cat-file tag "$1" > .tmp-vtag || exit 1
11 -cat .tmp-vtag | sed '/-----BEGIN PGP/Q' | gpg --verify .tmp-vtag - || exit 1
12 -rm -f .tmp-vtag
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"
16 +