Merge branch 'jk/ident-ai-canonname-could-be-null' into maint
[gitweb.git] / t / t4202-log.sh
index 0b53e566946e6e51ed83391aebce252c4ccaa4aa..e2db47c36e09e3580c53867909cd3e20bdf320f5 100755 (executable)
@@ -874,12 +874,15 @@ test_expect_success 'dotdot is a parent directory' '
        test_cmp expect actual
 '
 
-test_expect_success GPG 'log --graph --show-signature' '
+test_expect_success GPG 'setup signed branch' '
        test_when_finished "git reset --hard && git checkout master" &&
        git checkout -b signed master &&
        echo foo >foo &&
        git add foo &&
-       git commit -S -m signed_commit &&
+       git commit -S -m signed_commit
+'
+
+test_expect_success GPG 'log --graph --show-signature' '
        git log --graph --show-signature -n1 signed >actual &&
        grep "^| gpg: Signature made" actual &&
        grep "^| gpg: Good signature" actual
@@ -904,6 +907,31 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '
        grep "^| | gpg: Good signature" actual
 '
 
+test_expect_success GPG '--no-show-signature overrides --show-signature' '
+       git log -1 --show-signature --no-show-signature signed >actual &&
+       ! grep "^gpg:" actual
+'
+
+test_expect_success GPG 'log.showsignature=true behaves like --show-signature' '
+       test_config log.showsignature true &&
+       git log -1 signed >actual &&
+       grep "gpg: Signature made" actual &&
+       grep "gpg: Good signature" actual
+'
+
+test_expect_success GPG '--no-show-signature overrides log.showsignature=true' '
+       test_config log.showsignature true &&
+       git log -1 --no-show-signature signed >actual &&
+       ! grep "^gpg:" actual
+'
+
+test_expect_success GPG '--show-signature overrides log.showsignature=false' '
+       test_config log.showsignature false &&
+       git log -1 --show-signature signed >actual &&
+       grep "gpg: Signature made" actual &&
+       grep "gpg: Good signature" actual
+'
+
 test_expect_success 'log --graph --no-walk is forbidden' '
        test_must_fail git log --graph --no-walk
 '