summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pretty.c2
-rwxr-xr-xt/t7510-signed-commit.sh6
2 files changed, 8 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 3c43db558a..fe249f8820 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1267,6 +1267,8 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
if (c->signature_check.key)
strbuf_addstr(sb, c->signature_check.key);
break;
+ default:
+ return 0;
}
return 2;
}
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index e97477a3b9..9810242435 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -147,4 +147,10 @@ test_expect_success GPG 'show lack of signature with custom format' '
test_cmp expect actual
'
+test_expect_success 'unused %G placeholders are passed through' '
+ echo "%GX %G" >expect &&
+ git log -1 --format="%GX %G" >actual &&
+ test_cmp expect actual
+'
+
test_done