Web lists-archives.com

[PATCH 5/8] t/t7510: check the validation of the new config gpg.format




Valid values are already covered by all tests that use GPG, now also
test what happens if we go for an invalid one.

Signed-off-by: Henning Schild <henning.schild@xxxxxxxxxxx>
---
 t/t7510-signed-commit.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 6e2015ed9..cb523513f 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -227,4 +227,14 @@ test_expect_success GPG 'log.showsignature behaves like --show-signature' '
 	grep "gpg: Good signature" actual
 '
 
+test_expect_success GPG 'check gpg config for malformed values' '
+	mv .git/config .git/config.old &&
+	test_when_finished "mv .git/config.old .git/config" &&
+	git config gpg.format malformed &&
+	test_expect_code 128 git commit -S --amend -m "fail" 2>result &&
+	test_i18ngrep "malformed value for gpg.format: malformed" result &&
+	test_i18ngrep "fatal: .*\.git/config" result &&
+	test_i18ngrep "fatal: .*line 2" result
+'
+
 test_done
-- 
2.16.4