]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gpg-interface, tag: add GPG_VERIFY_OMIT_STATUS flag
authorLukas Puehringer <luk.puehringer@gmail.com>
Tue, 17 Jan 2017 23:37:18 +0000 (18:37 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Jan 2017 00:10:22 +0000 (16:10 -0800)
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>
gpg-interface.h
tag.c

index ea68885ad5b73aa63acc936eee52a61252420892..d2d4fd3a656e3f4953aea5eda3eea435f37f237e 100644 (file)
@@ -1,8 +1,9 @@
 #ifndef GPG_INTERFACE_H
 #define GPG_INTERFACE_H
 
-#define GPG_VERIFY_VERBOSE     1
-#define GPG_VERIFY_RAW         2
+#define GPG_VERIFY_VERBOSE             1
+#define GPG_VERIFY_RAW                 2
+#define GPG_VERIFY_OMIT_STATUS 4
 
 struct signature_check {
        char *payload;
diff --git a/tag.c b/tag.c
index d1dcd18cd7b53e21fa15bab9baad05cf16a3b9de..243d1fdbbcb1424b0082e1c999920f6a50b32d68 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -3,6 +3,7 @@
 #include "commit.h"
 #include "tree.h"
 #include "blob.h"
+#include "gpg-interface.h"
 
 const char *tag_type = "tag";
 
@@ -24,7 +25,9 @@ static int run_gpg_verify(const char *buf, unsigned long size, unsigned flags)
 
        ret = check_signature(buf, payload_size, buf + payload_size,
                                size - payload_size, &sigc);
-       print_signature_buffer(&sigc, flags);
+
+       if (!(flags & GPG_VERIFY_OMIT_STATUS))
+               print_signature_buffer(&sigc, flags);
 
        signature_check_clear(&sigc);
        return ret;