Files
git/t/helper/test-sha256.c
Taylor Blau d9213e4716 t/helper/test-tool: implement sha1-unsafe helper
With the new "unsafe" SHA-1 build knob, it is convenient to have a
test-tool that can exercise Git's unsafe SHA-1 wrappers for testing,
similar to 't/helper/test-tool sha1'.

Implement that helper by altering the implementation of that test-tool
(in cmd_hash_impl(), which is generic and parameterized over different
hash functions) to conditionally run the unsafe variants of the chosen
hash function, and expose the new behavior via a new 'sha1-unsafe' test
helper.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-01-23 10:28:16 -08:00

8 lines
138 B
C

#include "test-tool.h"
#include "hash.h"
int cmd__sha256(int ac, const char **av)
{
return cmd_hash_impl(ac, av, GIT_HASH_SHA256, 0);
}