summaryrefslogtreecommitdiff
path: root/t/t4202-log.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-12-05 20:52:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-12-05 20:52:46 (GMT)
commitf06dff7b7c1cfd273f2e23cfee547c0f05f76e31 (patch)
treebc6b9a5a57d036ca2b7eaab16751b6bdfbb249c2 /t/t4202-log.sh
parentc9208597a986509e6ce9b3c7936fd7a2b3bb3e43 (diff)
parent67a6ea63008bcee32a239934ad29eb5c5a554509 (diff)
downloadgit-f06dff7b7c1cfd273f2e23cfee547c0f05f76e31.zip
git-f06dff7b7c1cfd273f2e23cfee547c0f05f76e31.tar.gz
git-f06dff7b7c1cfd273f2e23cfee547c0f05f76e31.tar.bz2
Merge branch 'hi/gpg-optional-pkfp-fix'
The code to parse GPG output used to assume incorrectly that the finterprint for the primary key would always be present for a valid signature, which has been corrected. * hi/gpg-optional-pkfp-fix: gpg-interface: limit search for primary key fingerprint gpg-interface: refactor the free-and-xmemdupz pattern
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-xt/t4202-log.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index ab0d021..2c94894 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1570,6 +1570,14 @@ test_expect_success GPG 'setup signed branch' '
git commit -S -m signed_commit
'
+test_expect_success GPG 'setup signed branch with subkey' '
+ test_when_finished "git reset --hard && git checkout master" &&
+ git checkout -b signed-subkey master &&
+ echo foo >foo &&
+ git add foo &&
+ git commit -SB7227189 -m signed_commit
+'
+
test_expect_success GPGSM 'setup signed branch x509' '
test_when_finished "git reset --hard && git checkout master" &&
git checkout -b signed-x509 master &&
@@ -1580,6 +1588,18 @@ test_expect_success GPGSM 'setup signed branch x509' '
git commit -S -m signed_commit
'
+test_expect_success GPGSM 'log x509 fingerprint' '
+ echo "F8BF62E0693D0694816377099909C779FA23FD65 | " >expect &&
+ git log -n1 --format="%GF | %GP" signed-x509 >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success GPGSM 'log OpenPGP fingerprint' '
+ echo "D4BE22311AD3131E5EDA29A461092E85B7227189" > expect &&
+ git log -n1 --format="%GP" signed-subkey >actual &&
+ test_cmp expect actual
+'
+
test_expect_success GPG 'log --graph --show-signature' '
git log --graph --show-signature -n1 signed >actual &&
grep "^| gpg: Signature made" actual &&