aboutsummaryrefslogtreecommitdiff
path: root/t/t7612-merge-verify-signatures.sh
diff options
context:
space:
mode:
authorSebastian Götte <jaseg@physik.tu-berlin.de>2013-03-31 18:02:46 +0200
committerJunio C Hamano <gitster@pobox.com>2013-03-31 22:38:49 -0700
commiteb307ae7bb78ccde4e2ac69f302ccf8834883628 (patch)
tree40bed8e400a5208b7c81ff94752133818014da6b /t/t7612-merge-verify-signatures.sh
parentefed0022492b81bf59d29193c4ffe96492dd9e9b (diff)
downloadgit-eb307ae7bb78ccde4e2ac69f302ccf8834883628.tar.gz
git-eb307ae7bb78ccde4e2ac69f302ccf8834883628.tar.xz
merge/pull Check for untrusted good GPG signatures
When --verify-signatures is specified, abort the merge in case a good GPG signature from an untrusted key is encountered. Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7612-merge-verify-signatures.sh')
-rwxr-xr-xt/t7612-merge-verify-signatures.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7612-merge-verify-signatures.sh b/t/t7612-merge-verify-signatures.sh
index 6ccfbf367..21a0bf8fb 100755
--- a/t/t7612-merge-verify-signatures.sh
+++ b/t/t7612-merge-verify-signatures.sh
@@ -27,6 +27,10 @@ test_expect_success GPG 'create signed commits' '
git hash-object -w -t commit forged >forged.commit &&
git checkout initial &&
+ git checkout -b side-untrusted &&
+ echo 3 >baz && git add baz &&
+ test_tick && git commit -SB7227189 -m "untrusted on side"
+
git checkout master
'
@@ -40,6 +44,11 @@ test_expect_success GPG 'merge commit with bad signature with verification' '
test_i18ngrep "has a bad GPG signature" mergeerror
'
+test_expect_success GPG 'merge commit with untrusted signature with verification' '
+ test_must_fail git merge --ff-only --verify-signatures side-untrusted 2>mergeerror &&
+ test_i18ngrep "has an untrusted GPG signature" mergeerror
+'
+
test_expect_success GPG 'merge signed commit with verification' '
git merge --verbose --ff-only --verify-signatures side-signed >mergeoutput &&
test_i18ngrep "has a good GPG signature" mergeoutput