diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-02-07 21:29:00 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-07 21:31:42 -0800 |
commit | 6931049c32ca0271ba95dcd0f197100d22c8d844 (patch) | |
tree | c111c382d0995ed06d26294414f85c1d568b25d4 | |
parent | abfbff61efc4d91dc964eb2360760fa640ad0f0f (diff) | |
download | git-6931049c32ca0271ba95dcd0f197100d22c8d844.tar.gz |
ssh signing: signal an error with a negative return value
The other backend for the sign_buffer() function followed our usual
"an error is signalled with a negative return" convention, but the
SSH signer did not. Even though we already fixed the caller that
assumed only a negative return value is an error, tighten the callee
to signal an error with a negative return as well. This way, the
callees will be strict on what they produce, while the callers will
be lenient in what they accept.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | gpg-interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gpg-interface.c b/gpg-interface.c index 48f43c5a21..e19a69c400 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -1088,7 +1088,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature, if (strstr(signer_stderr.buf, "usage:")) error(_("ssh-keygen -Y sign is needed for ssh signing (available in openssh version 8.2p1+)")); - error("%s", signer_stderr.buf); + ret = error("%s", signer_stderr.buf); goto out; } |