Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,14 @@ if [ -n "$tags" ]; then
[ "$tagger" = "$CANONICAL" ] ||
fail "tag ${ref#refs/tags/} tagger is '${tagger}', expected '${CANONICAL}'"

# Everything after the header's blank line is the annotation body.
check_trailers "tag ${ref#refs/tags/}" "$(printf '%s\n' "$raw" | sed '1,/^$/d')" || exit 1
# The annotation body is everything after the header's blank line, minus
# any signature. A signed tag appends its signature block straight after
# the message with no blank line between -- so the last paragraph becomes
# message-plus-signature, which does not parse as trailers and would make
# this check silently pass on every signed tag. Strip the signature, then
# parse.
body="$(printf '%s\n' "$raw" | sed '1,/^$/d' | sed '/^-----BEGIN .*SIGNATURE-----$/,$d')"
check_trailers "tag ${ref#refs/tags/}" "$body" || exit 1
done <<< "$tags"
fi

Expand Down
Loading