@@ -1030,6 +1030,72 @@ test_expect_success GPG \
10301030 test_cmp expect actual
10311031'
10321032
1033+ # usage with rfc1991 signatures
1034+ echo " rfc1991" > gpghome/gpg.conf
1035+ get_tag_header rfc1991-signed-tag $commit commit $time > expect
1036+ echo " RFC1991 signed tag" >> expect
1037+ echo ' -----BEGIN PGP MESSAGE-----' >> expect
1038+ test_expect_success GPG \
1039+ ' creating a signed tag with rfc1991' '
1040+ git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit &&
1041+ get_tag_msg rfc1991-signed-tag >actual &&
1042+ test_cmp expect actual
1043+ '
1044+
1045+ cat > fakeeditor << 'EOF '
1046+ #!/bin/sh
1047+ cp "$1" actual
1048+ EOF
1049+ chmod +x fakeeditor
1050+
1051+ test_expect_success GPG \
1052+ ' reediting a signed tag body omits signature' '
1053+ echo "RFC1991 signed tag" >expect &&
1054+ GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
1055+ test_cmp expect actual
1056+ '
1057+
1058+ test_expect_success GPG \
1059+ ' verifying rfc1991 signature' '
1060+ git tag -v rfc1991-signed-tag
1061+ '
1062+
1063+ test_expect_success GPG \
1064+ ' list tag with rfc1991 signature' '
1065+ echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
1066+ git tag -l -n1 rfc1991-signed-tag >actual &&
1067+ test_cmp expect actual &&
1068+ git tag -l -n2 rfc1991-signed-tag >actual &&
1069+ test_cmp expect actual &&
1070+ git tag -l -n999 rfc1991-signed-tag >actual &&
1071+ test_cmp expect actual
1072+ '
1073+
1074+ rm -f gpghome/gpg.conf
1075+
1076+ test_expect_success GPG \
1077+ ' verifying rfc1991 signature without --rfc1991' '
1078+ git tag -v rfc1991-signed-tag
1079+ '
1080+
1081+ test_expect_success GPG \
1082+ ' list tag with rfc1991 signature without --rfc1991' '
1083+ echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
1084+ git tag -l -n1 rfc1991-signed-tag >actual &&
1085+ test_cmp expect actual &&
1086+ git tag -l -n2 rfc1991-signed-tag >actual &&
1087+ test_cmp expect actual &&
1088+ git tag -l -n999 rfc1991-signed-tag >actual &&
1089+ test_cmp expect actual
1090+ '
1091+
1092+ test_expect_success GPG \
1093+ ' reediting a signed tag body omits signature' '
1094+ echo "RFC1991 signed tag" >expect &&
1095+ GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
1096+ test_cmp expect actual
1097+ '
1098+
10331099# try to sign with bad user.signingkey
10341100git config user.signingkey BobTheMouse
10351101test_expect_success GPG \
0 commit comments