gpg-interface, tag: add GPG_VERIFY_OMIT_STATUS flag

Functions that print git object information may require that the gpg-interface functions be silent. Add GPG_VERIFY_OMIT_STATUS flag and prevent print_signature_buffer from being called if flag is set. Signed-off-by: Lukas Puehringer <luk.puehringer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Lukas Puehringer committed Jan 17, 2017 at 18:37 UTC 94240b918f70560393516aa8f98edb877d582c69
2 files changed +7 -3
gpg-interface.h
+3 -2
@@ -1,8 +1,9 @@
1 #ifndef GPG_INTERFACE_H
2 #define GPG_INTERFACE_H
3
4 -#define GPG_VERIFY_VERBOSE 1
5 -#define GPG_VERIFY_RAW 2
4 +#define GPG_VERIFY_VERBOSE 1
5 +#define GPG_VERIFY_RAW 2
6 +#define GPG_VERIFY_OMIT_STATUS 4
7
8 struct signature_check {
9 char *payload;
tag.c
+4 -1
@@ -3,6 +3,7 @@
3 #include "commit.h"
4 #include "tree.h"
5 #include "blob.h"
6 +#include "gpg-interface.h"
7
8 const char *tag_type = "tag";
9
@@ -24,7 +25,9 @@ static int run_gpg_verify(const char *buf, unsigned long size, unsigned flags)
25
26 ret = check_signature(buf, payload_size, buf + payload_size,
27 size - payload_size, &sigc);
27 - print_signature_buffer(&sigc, flags);
28 +
29 + if (!(flags & GPG_VERIFY_OMIT_STATUS))
30 + print_signature_buffer(&sigc, flags);
31
32 signature_check_clear(&sigc);
33 return ret;