diff options
Diffstat (limited to 'git-tag.sh')
-rwxr-xr-x | git-tag.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-tag.sh b/git-tag.sh index 94499c9b36..988bf4c6a6 100755 --- a/git-tag.sh +++ b/git-tag.sh @@ -112,7 +112,9 @@ git-check-ref-format "tags/$name" || object=$(git-rev-parse --verify --default HEAD "$@") || exit 1 type=$(git-cat-file -t $object) || exit 1 tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1 -: ${username:=$(expr "z$tagger" : 'z\(.*>\)')} + +keyid=$(git-repo-config user.signingkey) || + keyid=$(expr "z$tagger" : 'z\(.*>\)') trap 'rm -f "$GIT_DIR"/TAG_TMP* "$GIT_DIR"/TAG_FINALMSG "$GIT_DIR"/TAG_EDITMSG' 0 @@ -139,7 +141,7 @@ if [ "$annotate" ]; then cat "$GIT_DIR"/TAG_FINALMSG ) >"$GIT_DIR"/TAG_TMP rm -f "$GIT_DIR"/TAG_TMP.asc "$GIT_DIR"/TAG_FINALMSG if [ "$signed" ]; then - gpg -bsa -u "$username" "$GIT_DIR"/TAG_TMP && + gpg -bsa -u "$keyid" "$GIT_DIR"/TAG_TMP && cat "$GIT_DIR"/TAG_TMP.asc >>"$GIT_DIR"/TAG_TMP || die "failed to sign the tag with GPG." fi |