diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-02-24 22:32:29 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-24 22:32:29 +0300 |
commit | 38a227b796653d61a21d9b31e44e48dd66f647e0 (patch) | |
tree | 0be7f37dee5a80200ba2b7fd4f471764132879ab /gpg-interface.c | |
parent | 98619325c0befd7d41043910bf901224366f48c9 (diff) | |
parent | ad6b320756d8d9150291c696a02c86d1c2f0f4b2 (diff) |
Merge branch 'js/gpg-errors'
Error messages given upon a signature verification failure used to
discard the errors from underlying gpg program, which has been
corrected.
* js/gpg-errors:
gpg: do show gpg's error message upon failure
t7510: add a test case that does not need gpg
Diffstat (limited to 'gpg-interface.c')
-rw-r--r-- | gpg-interface.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index 687236430b..5cd66d3a78 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -977,9 +977,13 @@ static int sign_buffer_gpg(struct strbuf *buffer, struct strbuf *signature, break; /* found */ } ret |= !cp; + if (ret) { + error(_("gpg failed to sign the data:\n%s"), + gpg_status.len ? gpg_status.buf : "(no gpg output)"); + strbuf_release(&gpg_status); + return -1; + } strbuf_release(&gpg_status); - if (ret) - return error(_("gpg failed to sign the data")); /* Strip CR from the line endings, in case we are on Windows. */ remove_cr_after(signature, bottom); |