aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-tool.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2025-01-23 12:34:19 -0500
committerJunio C Hamano <gitster@pobox.com>2025-01-23 10:28:16 -0800
commitd9213e4716ec8d0ac543d32a52a39c79818cb8ca (patch)
tree8466d6053e07b2f194bc2747191e197eb3df06f4 /t/helper/test-tool.c
parentfbe8d3079d4a96aeb4e4529cc93cc0043b759a05 (diff)
downloadgit-d9213e4716ec8d0ac543d32a52a39c79818cb8ca.tar.gz
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>
Diffstat (limited to 't/helper/test-tool.c')
-rw-r--r--t/helper/test-tool.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 4a7aa993ba..958452ef12 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -70,6 +70,7 @@ static struct test_cmd cmds[] = {
{ "serve-v2", cmd__serve_v2 },
{ "sha1", cmd__sha1 },
{ "sha1-is-sha1dc", cmd__sha1_is_sha1dc },
+ { "sha1-unsafe", cmd__sha1_unsafe },
{ "sha256", cmd__sha256 },
{ "sigchain", cmd__sigchain },
{ "simple-ipc", cmd__simple_ipc },