summaryrefslogtreecommitdiff
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-23 15:45:16 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-23 15:45:16 -0700
commit5216bcbc845023fdea43b6d56f3634c490096838 (patch)
tree4f5984b483fbbb92da576fd4a6f9f03fae1ec54e /gpg-interface.c
parent98813265b360ebc59371d7d32efa47eb24adda15 (diff)
parentb5b3ddbe5c56c7ded95e7c47c985dc6d61f73ea0 (diff)
Merge branch 'cc/fast-import-export-signature-names'
Clean up the way how signature on commit objects are exported to and imported from fast-import stream. * cc/fast-import-export-signature-names: fast-(import|export): improve on commit signature output format
Diffstat (limited to 'gpg-interface.c')
-rw-r--r--gpg-interface.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpg-interface.c b/gpg-interface.c
index 12e1d5910e..d26c7135b0 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -144,6 +144,18 @@ static struct gpg_format *get_format_by_sig(const char *sig)
return NULL;
}
+const char *get_signature_format(const char *buf)
+{
+ struct gpg_format *format = get_format_by_sig(buf);
+ return format ? format->name : "unknown";
+}
+
+int valid_signature_format(const char *format)
+{
+ return (!!get_format_by_name(format) ||
+ !strcmp(format, "unknown"));
+}
+
void signature_check_clear(struct signature_check *sigc)
{
FREE_AND_NULL(sigc->payload);