]> git.ipfire.org Git - thirdparty/git.git/commit
t/helper/test-hash.c: use unsafe_hash_algo()
authorTaylor Blau <me@ttaylorr.com>
Thu, 23 Jan 2025 17:34:36 +0000 (12:34 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Jan 2025 18:28:17 +0000 (10:28 -0800)
commit3339180b28da5138eacb6b64f89c03e21493a73d
tree929f84e6ade42a2db28bfaa4b5b2cbd9e29069eb
parentf0c266af4ea7e4d9b84955f8fed8ee8cb009cbd8
t/helper/test-hash.c: use unsafe_hash_algo()

Remove a series of conditionals within the shared cmd_hash_impl() helper
that powers the 'sha1' and 'sha1-unsafe' helpers.

Instead, replace them with a single conditional that transforms the
specified hash algorithm into its unsafe variant. Then all subsequent
calls can directly use whatever function it wants to call without having
to decide between the safe and unsafe variants.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-hash.c