From ca194d50b84b53a0b711fef46d1a47657ec5da41 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 21 Jun 2015 23:14:41 +0000 Subject: gpg: centralize printing signature buffers The code to handle printing of signature data from a struct signature_check is very similar between verify-commit and verify-tag. Place this in a single function. verify-tag retains its special case behavior of printing the tag even when no valid signature is found. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- builtin/verify-commit.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'builtin/verify-commit.c') diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c index e30f7cfbc1..016319ada3 100644 --- a/builtin/verify-commit.c +++ b/builtin/verify-commit.c @@ -26,12 +26,7 @@ static int run_gpg_verify(const unsigned char *sha1, const char *buf, unsigned l memset(&signature_check, 0, sizeof(signature_check)); ret = check_commit_signature(lookup_commit(sha1), &signature_check); - - if (verbose && signature_check.payload) - fputs(signature_check.payload, stdout); - - if (signature_check.gpg_output) - fputs(signature_check.gpg_output, stderr); + print_signature_buffer(&signature_check, verbose ? GPG_VERIFY_VERBOSE : 0); signature_check_clear(&signature_check); return ret; -- cgit v1.2.3