@@ -39,23 +39,62 @@ test_expect_success GPG 'merge unsigned commit with verification' '
39
39
test_i18ngrep "does not have a GPG signature" mergeerror
40
40
'
41
41
42
+ test_expect_success GPG ' merge unsigned commit with merge.verifySignatures=true' '
43
+ test_config merge.verifySignatures true &&
44
+ test_must_fail git merge --ff-only side-unsigned 2>mergeerror &&
45
+ test_i18ngrep "does not have a GPG signature" mergeerror
46
+ '
47
+
42
48
test_expect_success GPG ' merge commit with bad signature with verification' '
43
49
test_must_fail git merge --ff-only --verify-signatures $(cat forged.commit) 2>mergeerror &&
44
50
test_i18ngrep "has a bad GPG signature" mergeerror
45
51
'
46
52
53
+ test_expect_success GPG ' merge commit with bad signature with merge.verifySignatures=true' '
54
+ test_config merge.verifySignatures true &&
55
+ test_must_fail git merge --ff-only $(cat forged.commit) 2>mergeerror &&
56
+ test_i18ngrep "has a bad GPG signature" mergeerror
57
+ '
58
+
47
59
test_expect_success GPG ' merge commit with untrusted signature with verification' '
48
60
test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror &&
49
61
test_i18ngrep "has an untrusted GPG signature" mergeerror
50
62
'
51
63
64
+ test_expect_success GPG ' merge commit with untrusted signature with merge.verifySignatures=true' '
65
+ test_config merge.verifySignatures true &&
66
+ test_must_fail git merge --ff-only side-untrusted 2>mergeerror &&
67
+ test_i18ngrep "has an untrusted GPG signature" mergeerror
68
+ '
69
+
52
70
test_expect_success GPG ' merge signed commit with verification' '
71
+ test_when_finished "git checkout initial" &&
53
72
git merge --verbose --ff-only --verify-signatures side-signed >mergeoutput &&
54
73
test_i18ngrep "has a good GPG signature" mergeoutput
55
74
'
56
75
76
+ test_expect_success GPG ' merge signed commit with merge.verifySignatures=true' '
77
+ test_when_finished "git checkout initial" &&
78
+ test_config merge.verifySignatures true &&
79
+ git merge --verbose --ff-only side-signed >mergeoutput &&
80
+ test_i18ngrep "has a good GPG signature" mergeoutput
81
+ '
82
+
57
83
test_expect_success GPG ' merge commit with bad signature without verification' '
84
+ test_when_finished "git checkout initial" &&
85
+ git merge $(cat forged.commit)
86
+ '
87
+
88
+ test_expect_success GPG ' merge commit with bad signature with merge.verifySignatures=false' '
89
+ test_when_finished "git checkout initial" &&
90
+ test_config merge.verifySignatures false &&
58
91
git merge $(cat forged.commit)
59
92
'
60
93
94
+ test_expect_success GPG ' merge commit with bad signature with merge.verifySignatures=true and --no-verify-signatures' '
95
+ test_when_finished "git checkout initial" &&
96
+ test_config merge.verifySignatures true &&
97
+ git merge --no-verify-signatures $(cat forged.commit)
98
+ '
99
+
61
100
test_done
0 commit comments