Skip to content

Commit 94240b9

Browse files
lukpuehgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3ef7618 commit 94240b9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

gpg-interface.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#ifndef GPG_INTERFACE_H
22
#define GPG_INTERFACE_H
33

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
67

78
struct signature_check {
89
char *payload;

tag.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "commit.h"
44
#include "tree.h"
55
#include "blob.h"
6+
#include "gpg-interface.h"
67

78
const char *tag_type = "tag";
89

@@ -24,7 +25,9 @@ static int run_gpg_verify(const char *buf, unsigned long size, unsigned flags)
2425

2526
ret = check_signature(buf, payload_size, buf + payload_size,
2627
size - payload_size, &sigc);
27-
print_signature_buffer(&sigc, flags);
28+
29+
if (!(flags & GPG_VERIFY_OMIT_STATUS))
30+
print_signature_buffer(&sigc, flags);
2831

2932
signature_check_clear(&sigc);
3033
return ret;

0 commit comments

Comments
 (0)