transport.c: mark more strings for translation
[gitweb.git] / t / t7510-signed-commit.sh
index 6e839f5489c5a8e3667d182f6de1873c2d29bd0a..6e2015ed9a199d6c6240a5fee850e72fd2fa65c3 100755 (executable)
@@ -2,6 +2,7 @@
 
 test_description='signed commit tests'
 . ./test-lib.sh
+GNUPGHOME_NOT_USED=$GNUPGHOME
 . "$TEST_DIRECTORY/lib-gpg.sh"
 
 test_expect_success GPG 'create signed commits' '
@@ -141,10 +142,9 @@ test_expect_success GPG 'show signed commit with signature' '
 
 test_expect_success GPG 'detect fudged signature' '
        git cat-file commit seventh-signed >raw &&
-
-       sed -e "s/seventh/7th forged/" raw >forged1 &&
+       sed -e "s/^seventh/7th forged/" raw >forged1 &&
        git hash-object -w -t commit forged1 >forged1.commit &&
-       ! git verify-commit $(cat forged1.commit) &&
+       test_must_fail git verify-commit $(cat forged1.commit) &&
        git show --pretty=short --show-signature $(cat forged1.commit) >actual1 &&
        grep "BAD signature from" actual1 &&
        ! grep "Good signature from" actual1
@@ -155,7 +155,7 @@ test_expect_success GPG 'detect fudged signature with NUL' '
        cat raw >forged2 &&
        echo Qwik | tr "Q" "\000" >>forged2 &&
        git hash-object -w -t commit forged2 >forged2.commit &&
-       ! git verify-commit $(cat forged2.commit) &&
+       test_must_fail git verify-commit $(cat forged2.commit) &&
        git show --pretty=short --show-signature $(cat forged2.commit) >actual2 &&
        grep "BAD signature from" actual2 &&
        ! grep "Good signature from" actual2
@@ -190,7 +190,7 @@ test_expect_success GPG 'show bad signature with custom format' '
        test_cmp expect actual
 '
 
-test_expect_success GPG 'show unknown signature with custom format' '
+test_expect_success GPG 'show untrusted signature with custom format' '
        cat >expect <<-\EOF &&
        U
        61092E85B7227189
@@ -200,6 +200,16 @@ test_expect_success GPG 'show unknown signature with custom format' '
        test_cmp expect actual
 '
 
+test_expect_success GPG 'show unknown signature with custom format' '
+       cat >expect <<-\EOF &&
+       E
+       61092E85B7227189
+
+       EOF
+       GNUPGHOME="$GNUPGHOME_NOT_USED" git log -1 --format="%G?%n%GK%n%GS" eighth-signed-alt >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success GPG 'show lack of signature with custom format' '
        cat >expect <<-\EOF &&
        N