aboutsummaryrefslogtreecommitdiffstats
path: root/gpg-interface.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2025-11-17 05:34:49 +0100
committerJunio C Hamano <gitster@pobox.com>2025-11-16 20:56:35 -0800
commitcb034c020aba54360e7c19faf82021399bf131e7 (patch)
tree5b2c6c1ef7dee393249c58f90f0052fee4bce45e /gpg-interface.c
parent388517c14ce62e1c52b091af862bbaf28dbabb7a (diff)
downloadgit-cb034c020aba54360e7c19faf82021399bf131e7.tar.gz
commit: refactor verify_commit_buffer()
In a following commit, we are going to check commit signatures, but we won't have a commit yet, only a commit buffer, and we are going to discard this commit buffer if the signature is invalid. So it would be wasteful to create a commit that we might discard, just to be able to check a commit signature. It would be simpler instead to be able to check commit signatures using only a commit buffer instead of a commit. To be able to do that, let's extract some code from the check_commit_signature() function into a new verify_commit_buffer() function, and then let's make check_commit_signature() call verify_commit_buffer(). Note that this doesn't fundamentally change how check_commit_signature() works. It used to call parse_signed_commit() which calls repo_get_commit_buffer(), parse_buffer_signed_by_header() and repo_unuse_commit_buffer(). Now these 3 functions are called directly by verify_commit_buffer(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.c')
0 files changed, 0 insertions, 0 deletions