]> git.ipfire.org Git - thirdparty/git.git/commit - gpg-interface.h
tag: fix sign_buffer() call to create a signed tag
authorJunio C Hamano <gitster@pobox.com>
Wed, 7 Feb 2024 18:46:54 +0000 (10:46 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Feb 2024 18:47:25 +0000 (10:47 -0800)
commitabfbff61efc4d91dc964eb2360760fa640ad0f0f
treefa525820b422eb6e524c7f554a6e82aeee80655f
parent564d0252ca632e0264ed670534a51d18a689ef5d
tag: fix sign_buffer() call to create a signed tag

The command "git tag -s" internally calls sign_buffer() to make a
cryptographic signature using the chosen backend like GPG and SSH.
The internal helper functions used by "git tag" implementation seem
to use a "negative return values are errors, zero or positive return
values are not" convention, and there are places (e.g., verify_tag()
that calls gpg_verify_tag()) that these internal helper functions
translate return values that signal errors to conform to this
convention, but do_sign() that calls sign_buffer() forgets to do so.

Fix it, so that a failed call to sign_buffer() that can return the
exit status from pipe_command() will not be overlooked.

Reported-by: Sergey Kosukhin <skosukhin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/tag.c
gpg-interface.h