aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-01-31 13:55:31 +0100
committerJunio C Hamano <gitster@pobox.com>2025-01-31 10:06:11 -0800
commit0578f1e66aa381356bfe2f53decf3864d88d23d3 (patch)
treeca26e9efacec048463fe529f72998ba59924f479 /t/unit-tests
parentb2755c15e2359c5436de062bf33a155a99c72c03 (diff)
downloadgit-0578f1e66aa381356bfe2f53decf3864d88d23d3.tar.gz
global: adapt callers to use generic hash context helpers
Adapt callers to use generic hash context helpers instead of using the hash algorithm to update them. This makes the callsites easier to reason about and removes the possibility that the wrong hash algorithm is used to update the hash context's state. And as a nice side effect this also gets rid of a bunch of users of `the_hash_algo`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests')
-rw-r--r--t/unit-tests/u-hash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/unit-tests/u-hash.c b/t/unit-tests/u-hash.c
index 05204e7b6c..bd4ac6a6e1 100644
--- a/t/unit-tests/u-hash.c
+++ b/t/unit-tests/u-hash.c
@@ -13,8 +13,8 @@ static void check_hash_data(const void *data, size_t data_length,
const struct git_hash_algo *algop = &hash_algos[i];
algop->init_fn(&ctx);
- algop->update_fn(&ctx, data, data_length);
- algop->final_fn(hash, &ctx);
+ git_hash_update(&ctx, data, data_length);
+ git_hash_final(hash, &ctx);
cl_assert_equal_s(hash_to_hex_algop(hash,algop), expected_hashes[i - 1]);
}