summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-tag.sh16
-rwxr-xr-xgit-verify-tag.sh7
2 files changed, 14 insertions, 9 deletions
diff --git a/git-tag.sh b/git-tag.sh
index c84043902f..3917cd8298 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -51,12 +51,16 @@ do
[ "$LINES" -le 0 ] && { echo "$TAG"; continue ;}
OBJTYPE=$(git cat-file -t "$TAG")
case $OBJTYPE in
- tag) ANNOTATION=$(git cat-file tag "$TAG" |
- sed -e '1,/^$/d' \
- -e '/^-----BEGIN PGP SIGNATURE-----$/Q' )
- printf "%-15s %s\n" "$TAG" "$ANNOTATION" |
- sed -e '2,$s/^/ /' \
- -e "${LINES}q"
+ tag)
+ ANNOTATION=$(git cat-file tag "$TAG" |
+ sed -e '1,/^$/d' |
+ sed -n -e "
+ /^-----BEGIN PGP SIGNATURE-----\$/q
+ 2,\$s/^/ /
+ p
+ ${LINES}q
+ ")
+ printf "%-15s %s\n" "$TAG" "$ANNOTATION"
;;
*) echo "$TAG"
;;
diff --git a/git-verify-tag.sh b/git-verify-tag.sh
index f2d5597dba..68858b694d 100755
--- a/git-verify-tag.sh
+++ b/git-verify-tag.sh
@@ -37,8 +37,9 @@ esac
trap 'rm -f "$GIT_DIR/.tmp-vtag"' 0
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
-
-cat "$GIT_DIR/.tmp-vtag" |
-sed '/-----BEGIN PGP/Q' |
+sed -n -e '
+ /^-----BEGIN PGP SIGNATURE-----$/q
+ p
+' <"$GIT_DIR/.tmp-vtag" |
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
rm -f "$GIT_DIR/.tmp-vtag"