Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='signed commit tests' |
| 4 | . ./test-lib.sh |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 5 | GNUPGHOME_NOT_USED=$GNUPGHOME |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 6 | . "$TEST_DIRECTORY/lib-gpg.sh" |
| 7 | |
| 8 | test_expect_success GPG 'create signed commits' ' |
Nicolas Vigier | 4b8d14b | 2013-12-16 14:55:04 +0100 | [diff] [blame] | 9 | test_when_finished "test_unconfig commit.gpgsign" && |
| 10 | |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 11 | echo 1 >file && git add file && |
| 12 | test_tick && git commit -S -m initial && |
| 13 | git tag initial && |
| 14 | git branch side && |
| 15 | |
| 16 | echo 2 >file && test_tick && git commit -a -S -m second && |
| 17 | git tag second && |
| 18 | |
| 19 | git checkout side && |
| 20 | echo 3 >elif && git add elif && |
| 21 | test_tick && git commit -m "third on side" && |
| 22 | |
| 23 | git checkout master && |
| 24 | test_tick && git merge -S side && |
| 25 | git tag merge && |
| 26 | |
| 27 | echo 4 >file && test_tick && git commit -a -m "fourth unsigned" && |
| 28 | git tag fourth-unsigned && |
| 29 | |
Junio C Hamano | c871a1d | 2012-01-05 10:54:14 -0800 | [diff] [blame] | 30 | test_tick && git commit --amend -S -m "fourth signed" && |
Nicolas Vigier | 4b8d14b | 2013-12-16 14:55:04 +0100 | [diff] [blame] | 31 | git tag fourth-signed && |
| 32 | |
| 33 | git config commit.gpgsign true && |
| 34 | echo 5 >file && test_tick && git commit -a -m "fifth signed" && |
| 35 | git tag fifth-signed && |
| 36 | |
| 37 | git config commit.gpgsign false && |
| 38 | echo 6 >file && test_tick && git commit -a -m "sixth" && |
| 39 | git tag sixth-unsigned && |
| 40 | |
| 41 | git config commit.gpgsign true && |
| 42 | echo 7 >file && test_tick && git commit -a -m "seventh" --no-gpg-sign && |
| 43 | git tag seventh-unsigned && |
| 44 | |
| 45 | test_tick && git rebase -f HEAD^^ && git tag sixth-signed HEAD^ && |
Jeff King | 99094a7 | 2015-03-20 06:07:15 -0400 | [diff] [blame] | 46 | git tag seventh-signed && |
Jeff King | 4baf839 | 2014-06-16 20:05:54 -0400 | [diff] [blame] | 47 | |
| 48 | echo 8 >file && test_tick && git commit -a -m eighth -SB7227189 && |
Junio C Hamano | 6694856 | 2016-05-02 14:58:45 -0700 | [diff] [blame] | 49 | git tag eighth-signed-alt && |
| 50 | |
| 51 | # commit.gpgsign is still on but this must not be signed |
Martin Ågren | 41a74bd | 2019-01-19 19:23:33 -0400 | [diff] [blame] | 52 | echo 9 | git commit-tree HEAD^{tree} >oid && |
| 53 | test_line_count = 1 oid && |
| 54 | git tag ninth-unsigned $(cat oid) && |
Junio C Hamano | 6694856 | 2016-05-02 14:58:45 -0700 | [diff] [blame] | 55 | # explicit -S of course must sign. |
Martin Ågren | 41a74bd | 2019-01-19 19:23:33 -0400 | [diff] [blame] | 56 | echo 10 | git commit-tree -S HEAD^{tree} >oid && |
| 57 | test_line_count = 1 oid && |
Brandon Richardson | 70ddbd7 | 2019-01-19 19:23:34 -0400 | [diff] [blame] | 58 | git tag tenth-signed $(cat oid) && |
| 59 | |
| 60 | # --gpg-sign[=<key-id>] must sign. |
| 61 | echo 11 | git commit-tree --gpg-sign HEAD^{tree} >oid && |
| 62 | test_line_count = 1 oid && |
| 63 | git tag eleventh-signed $(cat oid) && |
| 64 | echo 12 | git commit-tree --gpg-sign=B7227189 HEAD^{tree} >oid && |
| 65 | test_line_count = 1 oid && |
| 66 | git tag twelfth-signed-alt $(cat oid) |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 67 | ' |
| 68 | |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 69 | test_expect_success GPG 'verify and show signatures' ' |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 70 | ( |
Junio C Hamano | 6694856 | 2016-05-02 14:58:45 -0700 | [diff] [blame] | 71 | for commit in initial second merge fourth-signed \ |
Brandon Richardson | 70ddbd7 | 2019-01-19 19:23:34 -0400 | [diff] [blame] | 72 | fifth-signed sixth-signed seventh-signed tenth-signed \ |
| 73 | eleventh-signed |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 74 | do |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 75 | git verify-commit $commit && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 76 | git show --pretty=short --show-signature $commit >actual && |
Michael J Gruber | 7b1732c | 2014-06-16 20:03:43 -0400 | [diff] [blame] | 77 | grep "Good signature from" actual && |
| 78 | ! grep "BAD signature from" actual && |
| 79 | echo $commit OK || exit 1 |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 80 | done |
| 81 | ) && |
| 82 | ( |
Junio C Hamano | 6694856 | 2016-05-02 14:58:45 -0700 | [diff] [blame] | 83 | for commit in merge^2 fourth-unsigned sixth-unsigned \ |
| 84 | seventh-unsigned ninth-unsigned |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 85 | do |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 86 | test_must_fail git verify-commit $commit && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 87 | git show --pretty=short --show-signature $commit >actual && |
Michael J Gruber | 7b1732c | 2014-06-16 20:03:43 -0400 | [diff] [blame] | 88 | ! grep "Good signature from" actual && |
| 89 | ! grep "BAD signature from" actual && |
| 90 | echo $commit OK || exit 1 |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 91 | done |
Jeff King | 4baf839 | 2014-06-16 20:05:54 -0400 | [diff] [blame] | 92 | ) && |
| 93 | ( |
Brandon Richardson | 70ddbd7 | 2019-01-19 19:23:34 -0400 | [diff] [blame] | 94 | for commit in eighth-signed-alt twelfth-signed-alt |
Jeff King | 4baf839 | 2014-06-16 20:05:54 -0400 | [diff] [blame] | 95 | do |
| 96 | git show --pretty=short --show-signature $commit >actual && |
| 97 | grep "Good signature from" actual && |
| 98 | ! grep "BAD signature from" actual && |
| 99 | grep "not certified" actual && |
| 100 | echo $commit OK || exit 1 |
| 101 | done |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 102 | ) |
| 103 | ' |
| 104 | |
brian m. carlson | 434060e | 2015-06-21 23:14:40 +0000 | [diff] [blame] | 105 | test_expect_success GPG 'verify-commit exits success on untrusted signature' ' |
brian m. carlson | 8e98e5f | 2015-06-21 23:14:39 +0000 | [diff] [blame] | 106 | git verify-commit eighth-signed-alt 2>actual && |
| 107 | grep "Good signature from" actual && |
| 108 | ! grep "BAD signature from" actual && |
| 109 | grep "not certified" actual |
| 110 | ' |
| 111 | |
Hans Jerry Illikainen | 54887b4 | 2019-12-27 13:55:57 +0000 | [diff] [blame] | 112 | test_expect_success GPG 'verify-commit exits success with matching minTrustLevel' ' |
| 113 | test_config gpg.minTrustLevel ultimate && |
| 114 | git verify-commit sixth-signed |
| 115 | ' |
| 116 | |
| 117 | test_expect_success GPG 'verify-commit exits success with low minTrustLevel' ' |
| 118 | test_config gpg.minTrustLevel fully && |
| 119 | git verify-commit sixth-signed |
| 120 | ' |
| 121 | |
| 122 | test_expect_success GPG 'verify-commit exits failure with high minTrustLevel' ' |
| 123 | test_config gpg.minTrustLevel ultimate && |
| 124 | test_must_fail git verify-commit eighth-signed-alt |
| 125 | ' |
| 126 | |
brian m. carlson | aeff29d | 2015-06-21 23:14:42 +0000 | [diff] [blame] | 127 | test_expect_success GPG 'verify signatures with --raw' ' |
| 128 | ( |
| 129 | for commit in initial second merge fourth-signed fifth-signed sixth-signed seventh-signed |
| 130 | do |
| 131 | git verify-commit --raw $commit 2>actual && |
| 132 | grep "GOODSIG" actual && |
| 133 | ! grep "BADSIG" actual && |
| 134 | echo $commit OK || exit 1 |
| 135 | done |
| 136 | ) && |
| 137 | ( |
| 138 | for commit in merge^2 fourth-unsigned sixth-unsigned seventh-unsigned |
| 139 | do |
| 140 | test_must_fail git verify-commit --raw $commit 2>actual && |
| 141 | ! grep "GOODSIG" actual && |
| 142 | ! grep "BADSIG" actual && |
| 143 | echo $commit OK || exit 1 |
| 144 | done |
| 145 | ) && |
| 146 | ( |
| 147 | for commit in eighth-signed-alt |
| 148 | do |
| 149 | git verify-commit --raw $commit 2>actual && |
| 150 | grep "GOODSIG" actual && |
| 151 | ! grep "BADSIG" actual && |
| 152 | grep "TRUST_UNDEFINED" actual && |
| 153 | echo $commit OK || exit 1 |
| 154 | done |
| 155 | ) |
| 156 | ' |
| 157 | |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 158 | test_expect_success GPG 'show signed commit with signature' ' |
| 159 | git show -s initial >commit && |
| 160 | git show -s --show-signature initial >show && |
| 161 | git verify-commit -v initial >verify.1 2>verify.2 && |
| 162 | git cat-file commit initial >cat && |
Kyle J. McKay | 3f88c1b | 2015-03-09 13:03:01 -0700 | [diff] [blame] | 163 | grep -v -e "gpg: " -e "Warning: " show >show.commit && |
| 164 | grep -e "gpg: " -e "Warning: " show >show.gpg && |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 165 | grep -v "^ " cat | grep -v "^gpgsig " >cat.commit && |
| 166 | test_cmp show.commit commit && |
| 167 | test_cmp show.gpg verify.2 && |
| 168 | test_cmp cat.commit verify.1 |
| 169 | ' |
| 170 | |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 171 | test_expect_success GPG 'detect fudged signature' ' |
Jeff King | 526d56e | 2014-06-16 19:59:59 -0400 | [diff] [blame] | 172 | git cat-file commit seventh-signed >raw && |
SZEDER Gábor | 2f3cbcd | 2018-06-04 15:39:26 +0200 | [diff] [blame] | 173 | sed -e "s/^seventh/7th forged/" raw >forged1 && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 174 | git hash-object -w -t commit forged1 >forged1.commit && |
SZEDER Gábor | 9dd3982 | 2018-06-04 15:39:25 +0200 | [diff] [blame] | 175 | test_must_fail git verify-commit $(cat forged1.commit) && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 176 | git show --pretty=short --show-signature $(cat forged1.commit) >actual1 && |
| 177 | grep "BAD signature from" actual1 && |
| 178 | ! grep "Good signature from" actual1 |
| 179 | ' |
| 180 | |
| 181 | test_expect_success GPG 'detect fudged signature with NUL' ' |
Jeff King | 526d56e | 2014-06-16 19:59:59 -0400 | [diff] [blame] | 182 | git cat-file commit seventh-signed >raw && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 183 | cat raw >forged2 && |
| 184 | echo Qwik | tr "Q" "\000" >>forged2 && |
| 185 | git hash-object -w -t commit forged2 >forged2.commit && |
SZEDER Gábor | 9dd3982 | 2018-06-04 15:39:25 +0200 | [diff] [blame] | 186 | test_must_fail git verify-commit $(cat forged2.commit) && |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 187 | git show --pretty=short --show-signature $(cat forged2.commit) >actual2 && |
| 188 | grep "BAD signature from" actual2 && |
| 189 | ! grep "Good signature from" actual2 |
| 190 | ' |
| 191 | |
Junio C Hamano | c871a1d | 2012-01-05 10:54:14 -0800 | [diff] [blame] | 192 | test_expect_success GPG 'amending already signed commit' ' |
| 193 | git checkout fourth-signed^0 && |
| 194 | git commit --amend -S --no-edit && |
Michael J Gruber | 8e92c2c | 2014-06-23 09:05:51 +0200 | [diff] [blame] | 195 | git verify-commit HEAD && |
Junio C Hamano | c871a1d | 2012-01-05 10:54:14 -0800 | [diff] [blame] | 196 | git show -s --show-signature HEAD >actual && |
| 197 | grep "Good signature from" actual && |
| 198 | ! grep "BAD signature from" actual |
| 199 | ' |
| 200 | |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 201 | test_expect_success GPG 'show good signature with custom format' ' |
| 202 | cat >expect <<-\EOF && |
| 203 | G |
| 204 | 13B6F51ECDDE430D |
| 205 | C O Mitter <committer@example.com> |
Michał Górny | 3daaaab | 2018-10-22 18:38:20 +0200 | [diff] [blame] | 206 | 73D758744BE721698EC54E8713B6F51ECDDE430D |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 207 | 73D758744BE721698EC54E8713B6F51ECDDE430D |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 208 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 209 | git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual && |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 210 | test_cmp expect actual |
| 211 | ' |
| 212 | |
| 213 | test_expect_success GPG 'show bad signature with custom format' ' |
| 214 | cat >expect <<-\EOF && |
| 215 | B |
| 216 | 13B6F51ECDDE430D |
| 217 | C O Mitter <committer@example.com> |
Michał Górny | 3daaaab | 2018-10-22 18:38:20 +0200 | [diff] [blame] | 218 | |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 219 | |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 220 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 221 | git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" $(cat forged1.commit) >actual && |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 222 | test_cmp expect actual |
| 223 | ' |
| 224 | |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 225 | test_expect_success GPG 'show untrusted signature with custom format' ' |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 226 | cat >expect <<-\EOF && |
| 227 | U |
Michał Górny | 1e69084 | 2018-11-04 10:47:10 +0100 | [diff] [blame] | 228 | 65A0EEA02E30CAD7 |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 229 | Eris Discordia <discord@example.net> |
Michał Górny | 1e69084 | 2018-11-04 10:47:10 +0100 | [diff] [blame] | 230 | F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7 |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 231 | D4BE22311AD3131E5EDA29A461092E85B7227189 |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 232 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 233 | git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual && |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 234 | test_cmp expect actual |
| 235 | ' |
| 236 | |
Hans Jerry Illikainen | 54887b4 | 2019-12-27 13:55:57 +0000 | [diff] [blame] | 237 | test_expect_success GPG 'show untrusted signature with undefined trust level' ' |
| 238 | cat >expect <<-\EOF && |
| 239 | undefined |
| 240 | 65A0EEA02E30CAD7 |
| 241 | Eris Discordia <discord@example.net> |
| 242 | F8364A59E07FFE9F4D63005A65A0EEA02E30CAD7 |
| 243 | D4BE22311AD3131E5EDA29A461092E85B7227189 |
| 244 | EOF |
| 245 | git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual && |
| 246 | test_cmp expect actual |
| 247 | ' |
| 248 | |
| 249 | test_expect_success GPG 'show untrusted signature with ultimate trust level' ' |
| 250 | cat >expect <<-\EOF && |
| 251 | ultimate |
| 252 | 13B6F51ECDDE430D |
| 253 | C O Mitter <committer@example.com> |
| 254 | 73D758744BE721698EC54E8713B6F51ECDDE430D |
| 255 | 73D758744BE721698EC54E8713B6F51ECDDE430D |
| 256 | EOF |
| 257 | git log -1 --format="%GT%n%GK%n%GS%n%GF%n%GP" sixth-signed >actual && |
| 258 | test_cmp expect actual |
| 259 | ' |
| 260 | |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 261 | test_expect_success GPG 'show unknown signature with custom format' ' |
| 262 | cat >expect <<-\EOF && |
| 263 | E |
Michał Górny | 1e69084 | 2018-11-04 10:47:10 +0100 | [diff] [blame] | 264 | 65A0EEA02E30CAD7 |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 265 | |
Michał Górny | 3daaaab | 2018-10-22 18:38:20 +0200 | [diff] [blame] | 266 | |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 267 | |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 268 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 269 | GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" eighth-signed-alt >actual && |
Michael J Gruber | 661a180 | 2016-10-12 15:04:15 +0200 | [diff] [blame] | 270 | test_cmp expect actual |
| 271 | ' |
| 272 | |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 273 | test_expect_success GPG 'show lack of signature with custom format' ' |
| 274 | cat >expect <<-\EOF && |
| 275 | N |
| 276 | |
| 277 | |
Michał Górny | 3daaaab | 2018-10-22 18:38:20 +0200 | [diff] [blame] | 278 | |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 279 | |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 280 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 281 | git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" seventh-unsigned >actual && |
Jeff King | 06ca0f4 | 2014-06-16 20:06:24 -0400 | [diff] [blame] | 282 | test_cmp expect actual |
| 283 | ' |
| 284 | |
Mehul Jain | fce04c3 | 2016-06-22 22:21:26 +0530 | [diff] [blame] | 285 | test_expect_success GPG 'log.showsignature behaves like --show-signature' ' |
| 286 | test_config log.showsignature true && |
| 287 | git show initial >actual && |
| 288 | grep "gpg: Signature made" actual && |
| 289 | grep "gpg: Good signature" actual |
| 290 | ' |
| 291 | |
Henning Schild | 1865a64 | 2018-07-18 11:30:10 +0200 | [diff] [blame] | 292 | test_expect_success GPG 'check config gpg.format values' ' |
| 293 | test_config gpg.format openpgp && |
| 294 | git commit -S --amend -m "success" && |
| 295 | test_config gpg.format OpEnPgP && |
| 296 | test_must_fail git commit -S --amend -m "fail" |
| 297 | ' |
| 298 | |
Michał Górny | da6cf1b | 2018-10-20 21:30:20 +0200 | [diff] [blame] | 299 | test_expect_success GPG 'detect fudged commit with double signature' ' |
| 300 | sed -e "/gpgsig/,/END PGP/d" forged1 >double-base && |
| 301 | sed -n -e "/gpgsig/,/END PGP/p" forged1 | \ |
| 302 | sed -e "s/^gpgsig//;s/^ //" | gpg --dearmor >double-sig1.sig && |
| 303 | gpg -o double-sig2.sig -u 29472784 --detach-sign double-base && |
| 304 | cat double-sig1.sig double-sig2.sig | gpg --enarmor >double-combined.asc && |
| 305 | sed -e "s/^\(-.*\)ARMORED FILE/\1SIGNATURE/;1s/^/gpgsig /;2,\$s/^/ /" \ |
| 306 | double-combined.asc > double-gpgsig && |
| 307 | sed -e "/committer/r double-gpgsig" double-base >double-commit && |
| 308 | git hash-object -w -t commit double-commit >double-commit.commit && |
| 309 | test_must_fail git verify-commit $(cat double-commit.commit) && |
| 310 | git show --pretty=short --show-signature $(cat double-commit.commit) >double-actual && |
| 311 | grep "BAD signature from" double-actual && |
| 312 | grep "Good signature from" double-actual |
| 313 | ' |
| 314 | |
| 315 | test_expect_success GPG 'show double signature with custom format' ' |
| 316 | cat >expect <<-\EOF && |
| 317 | E |
| 318 | |
| 319 | |
Michał Górny | 3daaaab | 2018-10-22 18:38:20 +0200 | [diff] [blame] | 320 | |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 321 | |
Michał Górny | da6cf1b | 2018-10-20 21:30:20 +0200 | [diff] [blame] | 322 | EOF |
Michał Górny | 1a55052 | 2018-11-04 10:47:09 +0100 | [diff] [blame] | 323 | git log -1 --format="%G?%n%GK%n%GS%n%GF%n%GP" $(cat double-commit.commit) >actual && |
Michał Górny | da6cf1b | 2018-10-20 21:30:20 +0200 | [diff] [blame] | 324 | test_cmp expect actual |
| 325 | ' |
| 326 | |
Junio C Hamano | 247503f | 2011-10-19 17:15:05 -0700 | [diff] [blame] | 327 | test_done |