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
This commit is contained in:
Junio C Hamano
2023-02-24 11:32:29 -08:00
2 changed files with 50 additions and 2 deletions

View File

@ -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);