Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 06ca0f4

Browse files
peffgitster
authored andcommitted
t7510: check %G* pretty-format output
We do not check these along with the other pretty-format placeholders in t6006, because we need signed commits to make them interesting. t7510 has such commits, and can easily exercise them in addition to the regular --show-signature code path. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4baf839 commit 06ca0f4

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

t/t7510-signed-commit.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,44 @@ test_expect_success GPG 'amending already signed commit' '
107107
! grep "BAD signature from" actual
108108
'
109109

110+
test_expect_success GPG 'show good signature with custom format' '
111+
cat >expect <<-\EOF &&
112+
G
113+
13B6F51ECDDE430D
114+
C O Mitter <[email protected]>
115+
EOF
116+
git log -1 --format="%G?%n%GK%n%GS" sixth-signed >actual &&
117+
test_cmp expect actual
118+
'
119+
120+
test_expect_success GPG 'show bad signature with custom format' '
121+
cat >expect <<-\EOF &&
122+
B
123+
13B6F51ECDDE430D
124+
C O Mitter <[email protected]>
125+
EOF
126+
git log -1 --format="%G?%n%GK%n%GS" $(cat forged1.commit) >actual &&
127+
test_cmp expect actual
128+
'
129+
130+
test_expect_success GPG 'show unknown signature with custom format' '
131+
cat >expect <<-\EOF &&
132+
U
133+
61092E85B7227189
134+
Eris Discordia <[email protected]>
135+
EOF
136+
git log -1 --format="%G?%n%GK%n%GS" eighth-signed-alt >actual &&
137+
test_cmp expect actual
138+
'
139+
140+
test_expect_success GPG 'show lack of signature with custom format' '
141+
cat >expect <<-\EOF &&
142+
N
143+
144+
145+
EOF
146+
git log -1 --format="%G?%n%GK%n%GS" seventh-unsigned >actual &&
147+
test_cmp expect actual
148+
'
149+
110150
test_done

0 commit comments

Comments
 (0)